### Question:
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public void readFields(DataInput in) throws IOException { super.readFields(in); this.serverAddress.readFields(in); this.startCode = in.readLong(); this.webuiport = in.readInt(); } HServerInfo();  HServerInfo(final HServerAddress serverAddress, final int webuiport);  HServerInfo(HServerAddress serverAddress, long startCode,
      final int webuiport);  HServerInfo(HServerInfo other); byte getVersion(); synchronized HServerAddress getServerAddress(); synchronized long getStartCode(); int getInfoPort(); int getWebuiPort(); String getHostname(); @Override synchronized String toString(); @Override boolean equals(Object obj); @Override int hashCode(); void readFields(DataInput in); void write(DataOutput out); int compareTo(HServerInfo o);  }### Answer:
@Test public void testReadFields() throws IOException { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerInfo hsi1 = new HServerInfo(hsa1, 1L, 5678); HServerAddress hsa2 = new HServerAddress("localhost", 1235); HServerInfo hsi2 = new HServerInfo(hsa2, 1L, 5678); byte [] bytes = Writables.getBytes(hsi1); HServerInfo deserialized = (HServerInfo)Writables.getWritable(bytes, new HServerInfo()); assertEquals(hsi1, deserialized); bytes = Writables.getBytes(hsi2); deserialized = (HServerInfo)Writables.getWritable(bytes, new HServerInfo()); assertNotSame(hsa1, deserialized); }