### Question:
MySQLCommandPacketDecoder extends ByteToMessageDecoder { @Override protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) { if (States.Initiate.equals(currentState)) { out.add(decodeHandshakeInitializationPacket(in)); currentState = States.ResponsePacket; return; } if (States.FieldPacket.equals(currentState)) { decodeFieldPacket(in); return; } if (States.RowDataPacket.equals(currentState)) { decodeRowDataPacket(in, out); return; } decodeResponsePacket(in, out); }    }### Answer:
@Test(expected = UnsupportedOperationException.class) public void assertDecodeUnsupportedProtocolVersion() { MySQLCommandPacketDecoder commandPacketDecoder = new MySQLCommandPacketDecoder(); commandPacketDecoder.decode(null, byteBuf, null); }
@Test(expected = UnsupportedOperationException.class) public void assertDecodeUnsupportedAuthenticationMethod() { MySQLCommandPacketDecoder commandPacketDecoder = new MySQLCommandPacketDecoder(); when(byteBuf.readUnsignedByte()).thenReturn((short) PacketConstants.PROTOCOL_VERSION); commandPacketDecoder.decode(null, byteBuf, null); }
@Test public void assertDecode() { MySQLCommandPacketDecoder commandPacketDecoder = new MySQLCommandPacketDecoder(); List<Object> actual = new ArrayList<>(); commandPacketDecoder.decode(null, mockHandshakePacket(), actual); assertInitial(actual); actual.clear(); commandPacketDecoder.decode(null, mockOkPacket(), actual); assertPacketByType(actual, OkPacket.class); actual.clear(); commandPacketDecoder.decode(null, mockErrPacket(), actual); assertPacketByType(actual, ErrorPacket.class); actual.clear(); commandPacketDecoder.decode(null, mockResultSetPacket(), actual); commandPacketDecoder.decode(null, mockResultSetPacket(), actual); commandPacketDecoder.decode(null, mockEofPacket(), actual); commandPacketDecoder.decode(null, mockResultSetPacket(), actual); commandPacketDecoder.decode(null, mockEofPacket(), actual); assertPacketByType(actual, InternalResultSet.class); }