### Question:
FormatDescriptionEvent { public final void parse(final ByteBuf in) { binlogVersion = DataTypesCodec.readUnsignedInt2LE(in); mysqlServerVersion = DataTypesCodec.readFixedLengthString(50, in); createTimestamp = DataTypesCodec.readUnsignedInt4LE(in); eventHeaderLength = DataTypesCodec.readUnsignedInt1(in); DataTypesCodec.skipBytes(EventTypes.FORMAT_DESCRIPTION_EVENT - 1, in); short eventLength = DataTypesCodec.readUnsignedInt1(in); int remainLength = eventLength - 2 - 50 - 4 - 1 - (EventTypes.FORMAT_DESCRIPTION_EVENT - 1) - 1; DataTypesCodec.skipBytes(remainLength, in); if (0 < in.readableBytes()) { checksumType = DataTypesCodec.readUnsignedInt1(in); if (0 < checksumType) { checksumLength = in.readableBytes(); } DataTypesCodec.skipBytes(in.readableBytes(), in); } }  final void parse(final ByteBuf in);  }### Answer:
@Test public void assertParseWithoutChecksum() { int eventLength = 2 + 50 + 4 + 1 + (EventTypes.FORMAT_DESCRIPTION_EVENT - 1) + 1 + 23; ByteBuf byteBuf = Unpooled.buffer(eventLength); writeInfoIntoBuffer(byteBuf, eventLength); FormatDescriptionEvent actual = new FormatDescriptionEvent(); actual.parse(byteBuf); assertThat(actual.getBinlogVersion(), is(4)); String expectedServerVersion = "5.7.14-log" + new String(new byte[40]); assertThat(actual.getMysqlServerVersion(), is(expectedServerVersion)); assertThat(actual.getCreateTimestamp(), is(0x80000000L)); assertThat(actual.getEventHeaderLength(), is((short) 19)); assertThat(actual.getChecksumType(), is((short) 0)); assertThat(actual.getChecksumLength(), is(0)); }
@Test public void assertParseWithChecksum() { int eventLength = 2 + 50 + 4 + 1 + (EventTypes.FORMAT_DESCRIPTION_EVENT - 1) + 1 + 23; ByteBuf byteBuf = Unpooled.buffer(eventLength + 5); writeInfoIntoBuffer(byteBuf, eventLength); byteBuf.writeByte(1); byteBuf.writeBytes(new byte[4]); FormatDescriptionEvent actual = new FormatDescriptionEvent(); actual.parse(byteBuf); assertThat(actual.getBinlogVersion(), is(4)); String expectedServerVersion = "5.7.14-log" + new String(new byte[40]); assertThat(actual.getMysqlServerVersion(), is(expectedServerVersion)); assertThat(actual.getCreateTimestamp(), is(0x80000000L)); assertThat(actual.getEventHeaderLength(), is((short) 19)); assertThat(actual.getChecksumType(), is((short) 1)); assertThat(actual.getChecksumLength(), is(4)); }