How can I best compare two HashMap
s, if I want to find out if none of them contains different keys than the other, and if the values of that keys match each oth
/* JAVA 8 using streams*/
public static void main(String args[])
{
Map map = new HashMap();
map.put(100, true);
map.put(1011, false);
map.put(1022, false);
Map map1 = new HashMap();
map1.put(100, false);
map1.put(101, false);
map1.put(102, false);
boolean b = map.entrySet().stream().filter(value -> map1.entrySet().stream().anyMatch(value1 -> (value1.getKey() == value.getKey() && value1.getValue() == value.getValue()))).findAny().isPresent();
System.out.println(b);
}