### Question:
RowDescription extends PGMessage { public static RowDescription loadFromPacket(byte[] packet) { PGProto proto = new PGProto(packet, 5); int colCount = proto.readInt16(); if (colCount <= 0) { return new RowDescription(); } PGColumn[] columns = new PGColumn[colCount]; for (int i = 0; i < colCount; i++) { PGColumn column = new PGColumn(); column.setName(proto.readNullStr()); column.setTableOid(proto.readInt32()); column.setColNo(proto.readInt16()); column.setTypeOid(proto.readInt32()); column.setTypeLen(proto.readInt16()); column.setTypeMod(proto.readInt32()); column.setFormat(proto.readInt16()); columns[i] = column; } return new RowDescription(columns); } RowDescription();  RowDescription(PGColumn[] columns); PGColumn[] getColumns(); void setColumns(PGColumn[] columns); int getColCount(); static RowDescription loadFromPacket(byte[] packet); @Override String toString();  }### Answer:
@Test public void testPGColumnLoadFromPacket() { PGColumn column = getIdColumn(); byte[] bytes = column.toPacket(); PGColumn newColumn = PGColumn.loadFromPacket(bytes); assertEquals(newColumn.toPacket(), bytes); assertEquals(newColumn.getName(), column.getName()); assertEquals(newColumn.getTableOid(), column.getTableOid()); assertEquals(newColumn.getColNo(), column.getColNo()); assertEquals(newColumn.getTypeOid(), column.getTypeOid()); assertEquals(newColumn.getTypeLen(), column.getTypeLen()); assertEquals(newColumn.getTypeMod(), column.getTypeMod()); assertEquals(newColumn.getFormat(), column.getFormat()); }
@Test public void testLoadFromPacket() { PGColumn idColumn = getIdColumn(); PGColumn[] columns = new PGColumn[] {idColumn}; RowDescription rowDesc = new RowDescription(columns); byte[] bytes = rowDesc.toPacket(); RowDescription newRowDesc = RowDescription.loadFromPacket(bytes); assertEquals(newRowDesc.toPacket(), bytes); assertEquals(newRowDesc.getColCount(), rowDesc.getColCount()); PGColumn[] newColumns = newRowDesc.getColumns(); assertNotNull(newColumns); assertEquals(newColumns.length, columns.length); PGColumn newIdColumn = newColumns[0]; assertEquals(newIdColumn.toPacket(), idColumn.toPacket()); assertEquals(newIdColumn.getName(), idColumn.getName()); assertEquals(newIdColumn.getTableOid(), idColumn.getTableOid()); assertEquals(newIdColumn.getColNo(), idColumn.getColNo()); assertEquals(newIdColumn.getTypeOid(), idColumn.getTypeOid()); assertEquals(newIdColumn.getTypeLen(), idColumn.getTypeLen()); assertEquals(newIdColumn.getTypeMod(), idColumn.getTypeMod()); assertEquals(newIdColumn.getFormat(), idColumn.getFormat()); }