### Question:
ResultSetHeaderPacket extends AbstractPacket { @Override public void fromByteBuf(final ByteBuf data) { columnCount = DataTypesCodec.readLengthCodedIntLE(data); if (data.readableBytes() > 0) { extra = DataTypesCodec.readLengthCodedIntLE(data); } }  @Override void fromByteBuf(final ByteBuf data);  }### Answer:
@Test public void assertFromByteBufWithoutExtra() { ByteBuf byteBuf = Unpooled.buffer(); byteBuf.writeByte((byte) 0x80); ResultSetHeaderPacket actual = new ResultSetHeaderPacket(); actual.fromByteBuf(byteBuf); assertThat(actual.getColumnCount(), is(128L)); assertThat(actual.getExtra(), is(0L)); }
@Test public void assertFromByteBufWithExtra() { ByteBuf byteBuf = Unpooled.buffer(); byteBuf.writeByte((byte) 0x80); byteBuf.writeByte((byte) 0xff); ResultSetHeaderPacket actual = new ResultSetHeaderPacket(); actual.fromByteBuf(byteBuf); assertThat(actual.getColumnCount(), is(128L)); assertThat(actual.getExtra(), is(255L)); }