DoublingEventListenerDelegate (@NotNull PropertyChangeListener listener) { if (!myMap.containsKey(listener)) { myMap.put(listener, Pair.create(1, new DoublingEventListenerDelegate(listener))); } else { final Pair<Integer, DoublingEventListenerDelegate> oldPair = myMap.get(listener); myMap.put(listener, Pair.create(oldPair.getFirst() + 1, oldPair.getSecond())); } return myMap.get(listener).getSecond(); }