### Question:
BoonProtocolEncoder implements ProtocolEncoder { public String encodeResponses(String returnAddress, Collection<Response<Object>> responses) { 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); int index = 0; for (Response<Object> response : responses) { boolean encodeAddress = index == 0; encodeResponseAsString(buf, response, encodeAddress); buf.addChar(PROTOCOL_MESSAGE_SEPARATOR); index++; } return buf.toString(); }  String encodeResponses(String returnAddress, Collection<Response<Object>> responses); String encodeMethodCalls(String returnAddress, Collection<MethodCall<Object>> methodCalls);  }### Answer:
@Test public void response() throws Exception { final String returnAddress = UUID.randomUUID().toString(); ResponseBuilder responseBuilder = ResponseBuilder.responseBuilder().setReturnAddress(returnAddress) .setAddress("/foo/bar/service/trade").setBody(true).setId(999).setTimestamp(200); Response<Object> response = responseBuilder.build(); String string = boonProtocolEncoder.encodeResponses(returnAddress, Lists.list(response)); List<Message<Object>> parse = boonProtocolParser.parse("/foo/bar/service/trade", string); assertEquals(1, parse.size()); Message<Object> objectMessage = parse.get(0); assertTrue((objectMessage instanceof Response)); Response<Object> afterParse = (Response<Object>) objectMessage; assertEquals(response.address(), afterParse.address()); assertEquals(response.timestamp(), afterParse.timestamp()); assertEquals(response.id(), afterParse.id()); assertEquals(response.body().toString().toLowerCase(), afterParse.body().toString().toLowerCase()); }