### Question:
InvertOrder implements WritableRawComparable { public WritableRawComparable getEntity() { return entity; } InvertOrder(WritableRawComparable entity); WritableRawComparable getEntity(); @Override int getSizeInBytes(byte[] buf, int offset); @Override int compareInBytes(byte[] b1, int o1, byte[] b2, int o2); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override int compareTo(WritableRawComparable o); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void fundamental() throws Exception { IntOption entity = new IntOption(100); InvertOrder invert = new InvertOrder(entity); assertThat(invert.getEntity(), sameInstance((Object) entity)); }
@Test public void serialize() throws Exception { IntOption entity = new IntOption(100); InvertOrder invert = new InvertOrder(entity); byte[] serialized = ser(invert); InvertOrder restored = des(new InvertOrder(new IntOption()), serialized); assertThat(restored.getEntity(), is((Object) entity)); assertThat(restored.getEntity(), not(sameInstance((Object) entity))); }