assertEquals(cmd, m.commands().iterator().next());
}
@Test
public void testWriteTo() throws IOException {
RequestMessage m = new RequestMessage();
Command cmd = new Command(0xAA);
m.append(cmd);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
m.writeTo(dos);
byte[] buf = baos.toByteArray();
assertEquals(10, buf.length);
ByteArrayInputStream bais = new ByteArrayInputStream(buf);