@Override public void addTo(final NamespaceStorageNode storage, final K key, final V value) { delegate.addTo(storage, key, value); if (listeners != null) { notifyListeners(storage, listeners.iterator(), value); if (listeners.isEmpty()) { listeners = null; } } if (predicateListeners != null) { final Iterator<PredicateValueAddedListener<K, V>> it = predicateListeners.iterator(); while (it.hasNext()) { if (it.next().onValueAdded(key, value)) { it.remove(); } } if (predicateListeners.isEmpty()) { predicateListeners = null; } } notifyDerivedNamespaces(storage, key, value); } }