ColumnValue implements Serializable, Comparable<ColumnValue> { @Override public int compareTo(ColumnValue o) { if (this == o) { return 0; } int comp = column.compareTo(o.column); if (comp == 0) { comp = val.compareTo(o.val); } return comp; } ColumnValue(Column col, Bytes val);  ColumnValue(Column col, CharSequence val); Column getColumn(); Bytes getValue(); String getsValue(); @Override int compareTo(ColumnValue o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testCompare() { Column c1 = new Column("f1", "q1"); Column c2 = new Column("f2", "q1"); ColumnValue cv1 = new ColumnValue(c1, "v1"); ColumnValue cv2 = new ColumnValue(c2, "v1"); ColumnValue cv3 = new ColumnValue(c1, "v2"); ColumnValue cv4 = new ColumnValue(c1, "v1"); Assert.assertEquals(0, cv1.compareTo(cv1)); Assert.assertEquals(0, cv1.compareTo(cv4)); Assert.assertTrue(cv1.compareTo(cv2) < 0); Assert.assertTrue(cv2.compareTo(cv1) > 0); Assert.assertTrue(cv1.compareTo(cv3) < 0); Assert.assertTrue(cv3.compareTo(cv1) > 0); }