@Test
public void testInputWriteToStream() throws Exception {

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