Examples of using Default Methods introduced in Java 8 in Map interface
Using getOrDefault
Returns the value mapped to the key, or if the key is not present, returns the default value
Map<Integer, String> map = new HashMap<>();
map.put(1, "First element");
map.get(1); ...