ClientChannel channel = session.createChannel(ClientChannel.CHANNEL_SHELL);
channel.setIn(new ByteArrayInputStream(new byte[0]));
channel.setOut(new ByteArrayOutputStream());
channel.setErr(new ByteArrayOutputStream());
OpenFuture openFuture = channel.open();
CloseFuture closeFuture = session.close(true);
openFuture.await();
closeFuture.await();
assertNotNull(openFuture.getException());
assertNotNull(closeFuture.isClosed());
}