CloseableChannel implements Closeable { public InetSocketAddress address() { try { return (InetSocketAddress) channel.address(); } catch (NoSuchMethodError e) { try { return (InetSocketAddress) channelAddressMethod.invoke(this.channel); } catch (Exception ex) { throw new IllegalStateException("Unable to obtain address", ex); } } } CloseableChannel(DisposableChannel channel); InetSocketAddress address(); @Override void dispose(); @Override boolean isDisposed(); @Override Mono<Void> onClose();  }
@DisplayName("returns the address of the context") @Test void address() { channel .map(CloseableChannel::new) .map(CloseableChannel::address) .as(StepVerifier::create) .expectNextCount(1) .verifyComplete(); }