### Question:
RlpxAgent { public CompletableFuture<Integer> start() { if (!started.compareAndSet(false, true)) { return CompletableFuture.failedFuture( new IllegalStateException( "Unable to start an already started " + getClass().getSimpleName())); } setupListeners(); return connectionInitializer .start() .thenApply( (socketAddress) -> { LOG.info("P2P RLPx agent started and listening on {}.", socketAddress); return socketAddress.getPort(); }) .whenComplete( (res, err) -> { if (err != null) { LOG.error("Failed to start P2P RLPx agent. Check for port conflicts."); } }); } 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 start() { final CompletableFuture<Integer> future = agent.start(); assertThat(future).isDone(); assertThat(future).isNotCompletedExceptionally(); final CompletableFuture<Integer> future2 = agent.start(); assertThat(future2).isDone(); assertThat(future2).isCompletedExceptionally(); assertThatThrownBy(future2::get) .hasCauseInstanceOf(IllegalStateException.class) .hasMessageContaining("Unable to start an already started"); }