private DiscoveryPeer resolvePeer(final DiscoveryPeer peer) {
    if (peerTable.isIpAddressInvalid(peer.getEndpoint())) {
      return null;
    }
    final Optional<DiscoveryPeer> maybeKnownPeer =
        peerTable.get(peer).filter(known -> known.discoveryEndpointMatches(peer));
    DiscoveryPeer resolvedPeer = maybeKnownPeer.orElse(peer);
    if (maybeKnownPeer.isEmpty()) {
      final DiscoveryPeer bondingPeer = bondingPeers.getIfPresent(peer.getId());
      if (bondingPeer != null) {
        resolvedPeer = bondingPeer;
      }
    }

    return resolvedPeer;
  }
Returns a copy of the known peers. Modifications to the list will not update the table's state,
but modifications to the Peers themselves will.

@return List of peers.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/PeerDiscoveryController.java