lambda - Processing a list of maps using Java 8 streams -
how can simplify code single lambda expression? idea there list of maps , create new list of maps, using filter on key. in example, want remap keeps keys "x" , "z". map<string, string> m0 = new linkedhashmap<>(); m0.put("x", "123"); m0.put("y", "456"); m0.put("z", "789"); map<string, string> m1 = new linkedhashmap<>(); m1.put("x", "000"); m1.put("y", "111"); m1.put("z", "222"); list<map> l = new arraylist<>(arrays.aslist(m0, m1)); list<map> tx = new arraylist<>(); for(map<string, string> m : l) { map<string, string> filtered = m.entryset() .stream() .filter(map -> map.getkey().equals("x") || map.getkey().equals("z")) .collect(collectors.tomap(p -> p.getke...