@Test
public void testInputWriteToStream() throws Exception {

    Method method = EchoService.class.getMethod("echo", EchoRequest.class);
    JprotobufRpcMethodInfo rpcMethodInfo = new JprotobufRpcMethodInfo(method);
    EchoRequest request = new EchoRequest();
    request.setMessage("hello");
    ByteBuf buf = Unpooled.buffer(64);
    OutputStream outputStream = new ByteBufOutputStream(buf);
    CodedOutputStream codedOutputStream = CodedOutputStream.newInstance(outputStream);
    rpcMethodInfo.inputWriteToStream(request, codedOutputStream);
    Assert.assertTrue(buf.readableBytes()
            == Echo.EchoRequest.newBuilder().setMessage("hello").build().getSerializedSize());
}