FieldName implements IFieldName, Comparable<IFieldName> { @Override public int compareTo(final IFieldName that) { return name.compareTo(that.toString()); } FieldName(final String name); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override int compareTo(final IFieldName that);  }
@Test public void checkComparable() throws Exception { assertEquals(new FieldName("asd").compareTo(new FieldName("qwe")), "asd".compareTo("qwe")); }