### Question:
BoltChannel implements TrackedNetworkConnection { @Override public void close() { Channel rawChannel = rawChannel(); if ( rawChannel.isOpen() ) { rawChannel.close().syncUninterruptibly(); } } BoltChannel( String id, String connector, Channel rawChannel ); Channel rawChannel(); ClientConnectionInfo info(); @Override String id(); @Override long connectTime(); @Override String connector(); @Override SocketAddress serverAddress(); @Override SocketAddress clientAddress(); @Override String username(); @Override String userAgent(); @Override void updateUser( String username, String userAgent ); @Override void close(); @Override String toString();  }### Answer:
@Test void shouldCloseUnderlyingChannelWhenItIsOpen() { Channel channel = channelMock( true ); BoltChannel boltChannel = new BoltChannel( "bolt-1", "bolt", channel ); boltChannel.close(); verify( channel ).close(); }
@Test void shouldNotCloseUnderlyingChannelWhenItIsClosed() { Channel channel = channelMock( false ); BoltChannel boltChannel = new BoltChannel( "bolt-1", "bolt", channel ); boltChannel.close(); verify( channel, never() ).close(); }