V (@NotNull T key) { final V v = myMap.get(key); if (v != null) { return v == NULL ? null : v; } final V value = create(key); //noinspection unchecked V toPut = value == null ? (V)NULL : value; V prev = myMap.putIfAbsent(key, toPut); return prev == null || prev == NULL ? value : prev; }