LocalServerTransport implements ServerTransport<Closeable> { @Override public Mono<Closeable> start(ConnectionAcceptor acceptor) { Objects.requireNonNull(acceptor, "acceptor must not be null"); return Mono.create( sink -> { ServerCloseable closeable = new ServerCloseable(name, acceptor); if (registry.putIfAbsent(name, acceptor) != null) { throw new IllegalStateException("name already registered: " + name); } sink.success(closeable); }); } private  LocalServerTransport(String name); static LocalServerTransport create(String name); static LocalServerTransport createEphemeral(); static void dispose(String name); LocalClientTransport clientTransport(); @Override Mono<Closeable> start(ConnectionAcceptor acceptor);  }
@DisplayName("starts local server transport") @Test void start() { LocalServerTransport.createEphemeral() .start(duplexConnection -> Mono.empty()) .as(StepVerifier::create) .expectNextCount(1) .verifyComplete(); }