void (Entry<N> entry, K key) { if (key != null) { Entry<N> removed = map.remove(key); if (removed == null) { LOG.warn("MapBasedTree: expected entry is not found"); } else if (removed != entry) { LOG.warn("MapBasedTree: do not remove unexpected entry"); map.put(key, removed); return; } } removeChildren(entry, entry.children); Consumer<? super N> consumer = nodeRemoved; if (consumer != null) consumer.accept(entry.node); }