// build the buffer that will contain all the generated output data
ByteBuf generatedOutputBytes = Unpooled.buffer(65);
generatedOutputBytes = generatedOutputBytes.order(ByteOrder.LITTLE_ENDIAN);
// serialize the given packet
packetSerializer.serialize(testIncomingPacket, generatedOutputBytes);
// compare the size of each bufffer
assertEquals(neededOutputBytes.writerIndex(), generatedOutputBytes.writerIndex());
int writerIndex = generatedOutputBytes.writerIndex();