public void call() throws Exception {
final SshClient client = SshClient.setUpDefaultClient();
client.start();
try {
final ClientSession session = client.connect("localhost", 4222).await().getSession();
session.authPassword("jonathan", "secret");
final ClientChannel channel = session.createChannel("shell");
final ByteArrayOutputStream sent = new ByteArrayOutputStream();
final PipedOutputStream pipedIn = new TeePipedOutputStream(sent);
channel.setIn(new PipedInputStream(pipedIn));