### Question:
RlpxAgent { public Optional<CompletableFuture<PeerConnection>> getPeerConnection(final Peer peer) { final RlpxConnection connection = connectionsById.get(peer.getId()); return Optional.ofNullable(connection) .filter(conn -> !conn.isFailedOrDisconnected()) .map(RlpxConnection::getFuture); } private  RlpxAgent(
      final LocalNode localNode,
      final PeerConnectionEvents connectionEvents,
      final ConnectionInitializer connectionInitializer,
      final PeerRlpxPermissions peerPermissions,
      final PeerPrivileges peerPrivileges,
      final int maxConnections,
      final int maxRemotelyInitiatedConnections,
      final MetricsSystem metricsSystem); static Builder builder(); CompletableFuture<Integer> start(); CompletableFuture<Void> stop(); Stream<? extends PeerConnection> streamConnections(); int getConnectionCount(); void connect(final Stream<? extends Peer> peerStream); void disconnect(final Bytes peerId, final DisconnectReason reason); Optional<CompletableFuture<PeerConnection>> getPeerConnection(final Peer peer); CompletableFuture<PeerConnection> connect(final Peer peer); void subscribeMessage(final Capability capability, final MessageCallback callback); void subscribeConnect(final ConnectCallback callback); void subscribeDisconnect(final DisconnectCallback callback);  }### Answer:
@Test public void incomingConnect_succeeds() { startAgent(); final Peer peer = createPeer(); final PeerConnection connection = connection(peer); connectionInitializer.simulateIncomingConnection(connection); final Optional<CompletableFuture<PeerConnection>> trackedConnection = agent.getPeerConnection(peer); assertThat(trackedConnection).isNotEmpty(); assertThat(trackedConnection.get()).isCompletedWithValue(connection); }