int (@NotNull K key) { Object current = myMap.get(key); if (current == null) { return 0; } else if (current instanceof ValueList) { //noinspection unchecked return ((ValueList<V>)current).size(); } return 1; }