private void insert(Entry<N> entry, K key) {
    if (key != null) {
      Entry<N> removed = map.put(key, entry);
      if (removed != null) {
        LOG.warn("MapBasedTree: do not replace unexpected entry");
        map.put(key, removed);
        return;
      }
    }
    Consumer<? super N> consumer = nodeInserted;
    if (consumer != null) consumer.accept(entry.node);
  }
private void insert(Entry<N> entry, K key)