### Question:
RlpxAgent { public void subscribeDisconnect(final DisconnectCallback callback) { connectionEvents.subscribeDisconnect(callback); } 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 subscribeDisconnect() { final Peer peer = createPeer(); startAgent(); final AtomicReference<PeerConnection> connection = new AtomicReference<>(); agent.subscribeDisconnect((conn, reason, initiatedByPeer) -> connection.set(conn)); agent.connect(peer); agent.disconnect(peer.getId(), DisconnectReason.REQUESTED); assertThat(connection.get()).isNotNull(); Assertions.assertThat(connection.get().getPeer()).isEqualTo(peer); }