@Override
    protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) {
        MySQLPacketPayload payload = new MySQLPacketPayload(in, ctx.channel().attr(CommonConstants.CHARSET_ATTRIBUTE_KEY).get());
        if (handshakeReceived) {
            MySQLPacket responsePacket = decodeResponsePacket(payload);
            if (responsePacket instanceof MySQLOKPacket) {
                ctx.channel().pipeline().remove(this);
            }
            out.add(responsePacket);
        } else {
            out.add(decodeHandshakePacket(payload));
            handshakeReceived = true;
        }
    }
@Test
    void assertDecodeHandshakePacket() {
        MySQLNegotiatePackageDecoder commandPacketDecoder = new MySQLNegotiatePackageDecoder();
        List<Object> actual = new LinkedList<>();
        commandPacketDecoder.decode(channelHandlerContext, mockHandshakePacket(), actual);
        assertHandshakePacket(actual);
    }