@Test(timeout = 5000)
public void testSendInput() throws Exception {

    Assert.assertTrue(server.isStarted());
    String input = "Test123";
    final Thread thread = new Thread() {
        @Override
        public void run() {
            try {
                synchronized (lock) {
                    lock.notifyAll();
                }
                final InputStream in = socket.getInputStream();
                System.out.println("1");
                rcvd = TextMessage.parseDelimitedFrom(in);
                System.out.println(2);
                synchronized (lock) {
                    lock.notifyAll();
                }
            } catch (Exception e) {
                Assert.fail(e.getMessage());
            }
        }
    };
    thread.start();
    synchronized (lock) {
        lock.wait();
    }
    server.sendInput(input);
    if (thread.isAlive()) {
        synchronized (lock) {
            lock.wait();
        }
    }
    final TextMessage message = TextMessage.newBuilder()
            .setType(TextMessageType.USER).setData(input)
            .setSequenceNumber(0).build();
    Assert.assertEquals(message, rcvd);
}