@Test
public void shouldPlaceMultipleMessagesInSameBuffer() throws Exception
{

    final FixMessage loginMessage = new FixMessageBuilder().messageType(MsgType.LOGIN).msgSeqNum(1).senderCompID("username").targetCompID("LMXBL").
            sendingTime(DateTime.parse("19981231-23:58:59.000", DATE_TIME_FORMATTER)).username("username").password("password").heartBtInt(100000).encryptMethod(EncryptMethod.NONE).build();
    final FixMessage logoutMessage = new FixMessageBuilder().messageType(MsgType.LOGOUT).msgSeqNum(2).senderCompID("username").targetCompID("LMXBL").
            sendingTime(DateTime.parse("19981231-23:59:59.000", DATE_TIME_FORMATTER)).build();
    final List<FixMessage> expected = newArrayList(loginMessage, logoutMessage);
    mockery.checking(new Expectations()
    {
        {
            one(writableByteChannel).write(with(new ByteBufferMatcher(expected)));
        }
    });
    handler.send(expected);
}