Map.get
which could be replaced with computeIfAbsent
.
Map.computeIfAbsent method could be used to replace the code like this:
List<String> list = map.get(key); if (list == null) { list = new ArrayList<>(); map.put(key, list); }
This conversion is available since Java 8 only.
New in 2016.3