### Question:
DataRow extends PGMessage { public static DataRow loadFromPacket(byte[] packet) { PGProto proto = new PGProto(packet, 5); int colCount = proto.readInt16(); if (colCount <= 0) { return new DataRow(); } PGCol[] cols = new PGCol[colCount]; for (int i = 0; i < colCount; i++) { int colDataLen = proto.readInt32(); if (colDataLen < 0) { cols[i] = new PGCol(); continue; } cols[i] = new PGCol(proto.readBytes(colDataLen)); } return new DataRow(cols); } DataRow();  DataRow(PGCol[] cols); PGCol[] getCols(); void setCols(PGCol[] cols); int getColCount(); static DataRow loadFromPacket(byte[] packet); @Override String toString();  }### Answer:
@Test public void testLoadFromPacket() { byte[] nameData = "dataRow".getBytes(); PGCol namePgCol = new PGCol(nameData); PGCol[] pgCols = new PGCol[] {namePgCol}; DataRow dataRow = new DataRow(pgCols); byte[] dataRowBytes = dataRow.toPacket(); DataRow newDataRow = DataRow.loadFromPacket(dataRowBytes); assertEquals(newDataRow.toPacket(), dataRowBytes); assertEquals(newDataRow.getColCount(), dataRow.getColCount()); PGCol[] newPgCols = newDataRow.getCols(); assertNotNull(newPgCols); assertEquals(newPgCols.length, pgCols.length); PGCol newNamePgCol = newPgCols[0]; assertEquals(newNamePgCol.getDataLen(), namePgCol.getDataLen()); assertEquals(newNamePgCol.getData(), nameData); }