I noticed that if I do map.getOrDefault(\"key1\", new Object()), even if object is present for key1 in the map, new Object() is created. Though it is n
This is not because of how the map is implemented, it is because of how Java works. The runtime interpreter has to create the object first (the new Empl part) before it can actually invoke the method (the getOrDefault part).