@Test
public void testIsEmpty() {

    final Message message = new Message();
    assertTrue("Message should be empty on construction", message.isEmpty());
    message.getHeader().setField(new BeginString("FIX.4.2"));
    assertFalse("Header should contain a field", message.isEmpty());
    message.clear();
    assertTrue("Message should be empty after clear", message.isEmpty());
    message.setField(new Symbol("MSFT"));
    assertFalse("Body should contain a field", message.isEmpty());
    message.clear();
    assertTrue("Message should be empty after clear", message.isEmpty());
    message.getTrailer().setField(new CheckSum("10"));
    assertFalse("Trailer should contain a field", message.isEmpty());
    message.clear();
    assertTrue("Message should be empty after clear", message.isEmpty());
}