### Question:
BoonProtocolEncoder implements ProtocolEncoder { public String encodeMethodCalls(String returnAddress, Collection<MethodCall<Object>> methodCalls) { CharBuf buf = bufRef.get(); buf.recycle(); buf.addChar(PROTOCOL_MARKER); buf.addChar(PROTOCOL_MESSAGE_TYPE_GROUP); buf.addChar(PROTOCOL_SEPARATOR); buf.add(returnAddress); buf.addChar(PROTOCOL_SEPARATOR); buf.addChar(PROTOCOL_MESSAGE_SEPARATOR); for (MethodCall<Object> methodCall : methodCalls) { encodeMethodCallAsString(buf, methodCall); buf.addChar(PROTOCOL_MESSAGE_SEPARATOR); } return buf.toString(); }  String encodeResponses(String returnAddress, Collection<Response<Object>> responses); String encodeMethodCalls(String returnAddress, Collection<MethodCall<Object>> methodCalls);  }### Answer:
@Test public void methodCall() throws Exception { final String returnAddress = UUID.randomUUID().toString(); MethodCallBuilder methodCallBuilder = MethodCallBuilder.methodCallBuilder() .setName("trade") .setObjectName("tradeservice") .setAddress("/foo/bar/service/trade") .setReturnAddress(returnAddress) .setTimestamp(System.currentTimeMillis()) .setBody(new Trade()).setId(2L); MethodCall<Object> methodCall = methodCallBuilder.build(); String string = boonProtocolEncoder.encodeMethodCalls(returnAddress, Lists.list(methodCall)); List<Message<Object>> parse = boonProtocolParser.parse("/foo/bar/service/trade", string); assertEquals(1, parse.size()); Message<Object> objectMessage = parse.get(0); assertTrue((objectMessage instanceof MethodCall)); MethodCall<Object> afterParse = (MethodCall<Object>) objectMessage; assertEquals(methodCall.name(), afterParse.name()); assertEquals(methodCall.address(), afterParse.address()); assertEquals(methodCall.returnAddress(), afterParse.returnAddress()); assertEquals(methodCall.timestamp(), afterParse.timestamp()); assertEquals(methodCall.id(), afterParse.id()); }