// verify correctness
Assert.assertEquals("server content length unequal", contents.length, req.getContent().length);
Assert.assertTrue("server contents do not match", Arrays.equals(contents, req.getContent()));
// echo message back to client
final Response rsp = new Response();
rsp.setPayload(contents);
Assert.assertTrue(Arrays.equals(contents, rsp.getPayload()));
handler.sendResponse(rsp, req);
// read out message at client
final byte[] msg1 = readInputStream(in, true);
Assert.assertTrue("zero-length message", msg1.length > 0);