@@ -0,0 +1,464 @@
+package org.psjava.util;%0A%0Aimport org.psjava.ds.math.Function;%0A%0Aimport java.util.Map;%0A%0Apublic class GetOrInitial %7B%0A%0A    public static %3CK, V%3E V getOrInitial(Map%3CK, V%3E map, K key, Function%3CK, V%3E initialValueFactory) %7B%0A        V existOrNull = map.get(key);%0A        if (existOrNull == null) %7B%0A            V init = initialValueFactory.get(key);%0A            map.put(key, init);%0A            return init;%0A        %7D else %7B%0A            return existOrNull;%0A        %7D%0A    %7D%0A%0A%7D%0A

add a util - GetOrInitial