class PeerTable {

  public EvictResult tryEvict(final PeerId peer) {
    final Bytes id = peer.getId();
    final int distance = distanceFrom(peer);

    if (distance == 0) {
      return EvictResult.self();
    }

    distanceCache.remove(id);

    if (table[distance].getPeers().isEmpty()) {
      return EvictResult.absent();
    }

    final boolean evicted = table[distance].evict(peer);
    if (evicted) {
      evictionCnt++;
    } else {
      return EvictResult.absent();
    }

    // Trigger the bloom filter regeneration if needed.
    if (evictionCnt >= BLOOM_FILTER_REGENERATION_THRESHOLD) {
      ForkJoinPool.commonPool().execute(this::buildBloomFilter);
    }

    return EvictResult.evicted();
  }

  public  PeerTable(final Bytes nodeId, final int bucketSize);
  public  PeerTable(final Bytes nodeId);

}