@Test
public void serialize() throws Exception, PacketParserException {

    HandshakeChallengePacket handshakeChallengePacket = new HandshakeChallengePacket();
    byte[] bytes = handshakeChallengePacket.getParser().serialize();
    assertEquals(PACKETS.HANDSHAKE_CHALLENGE.ordinal(), bytes[0]);
    short size = (short) ((0xff & bytes[1]) << 8 | (0xff & bytes[2]));
    byte[] challengeAfter = new byte[size];
    System.arraycopy(bytes, 3, challengeAfter, 0, size);
    assertArrayEquals(handshakeChallengePacket.getChallenge(), challengeAfter);
}