void (int cost, @NotNull ObjectIntMap<String> costMap, @NotNull ObjectIntMap<String> countMap) { String name = getClass().getSuperclass().getName(); int storedCost = costMap.get(name); costMap.put(name, (storedCost == -1 ? 0 : storedCost) + cost); int storedCount = countMap.get(name); countMap.put(name, storedCount == -1 ? 1 : storedCount + 1); }