@Test
public void testOutputEncode() throws Exception {

    Method method = EchoService.class.getMethod("echo", EchoRequest.class);
    JprotobufRpcMethodInfo rpcMethodInfo = new JprotobufRpcMethodInfo(method);
    EchoResponse response = new EchoResponse();
    response.setMessage("hello");
    byte[] bytes = rpcMethodInfo.outputEncode(response);
    Assert.assertTrue(bytes.length
            == Echo.EchoResponse.newBuilder().setMessage("hello").build().toByteArray().length);
}