private Connection createReceiverConnectionOnFirstAccept(final ServerSocketChannel acceptorSocket,
      final boolean isSenderInView) {
    try {
      final SocketChannel readerSocket = acceptorSocket.accept();
      final ConnectionTable readerTable = mockConnectionTable(false);
      if (isSenderInView) {
        when(readerTable.getConduit().waitForMembershipCheck(any())).thenReturn(true);
      }

      final Connection reader = spy(new Connection(readerTable, readerSocket.socket()));
      CompletableFuture.runAsync(() -> {
        try {
          reader.initReceiver();
        } catch (final RuntimeException e) {
          e.printStackTrace();
          throw e;
        }
      });
      return reader;
    } catch (final Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
  }
Create a sender that connects to the server socket.
geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionTransmissionTest.java