### Question:
ReadyForQuery extends PGMessage { public static ReadyForQuery loadFromPacket(byte[] packet) { byte status = packet[packet.length - 1]; switch (status) { case IDLE_BYTE: return IDLE; case IN_TX_BYTE: return IN_TX; case IN_FAILED_TX_BYTE: return IN_FAILED_TX; default: throw new IllegalArgumentException( "illegal ReadyForQuery packet " + Arrays.toString(packet)); } } ReadyForQuery(byte status); byte getStatus(); static ReadyForQuery loadFromPacket(byte[] packet); @Override String toString(); static final byte IDLE_BYTE; static final byte IN_TX_BYTE; static final byte IN_FAILED_TX_BYTE; static final ReadyForQuery IDLE; static final ReadyForQuery IN_TX; static final ReadyForQuery IN_FAILED_TX; }### Answer:
@Test public void testLoadFromPacket() throws Exception { ReadyForQuery readyForQuery = ReadyForQuery.loadFromPacket(packet); byte expectedStatus = (byte) 'I'; assertEquals(readyForQuery.getStatus(), expectedStatus); }