public boolean remove(final Peer peer) {
    final boolean wasRemoved = maintainedPeers.remove(peer);
    removedCallbackSubscribers.forEach(s -> s.onPeerRemoved(peer, wasRemoved));
    return wasRemoved;
  }
Represents a set of peers for which connections should be actively maintained.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/peers/MaintainedPeers.java