I want to find out if the HashMap
has all its values empty or not. What is the best way to do it other than having to check the value in every entry in the map?
HashMap<Long, Optional<Long>> aMap = new HashMap<>();
aMap.put(new Long(55), Optional.empty());
aMap.put(new Long(66), Optional.empty());
aMap.put(new Long(77), Optional.empty());
aMap.put(new Long(99), Optional.empty());