ResourceItemCommonDataId implements Serializable, Comparable<ResourceItemCommonDataId> { @Override public int compareTo(ResourceItemCommonDataId o) { int compare1 = this.resourceName.compareTo(o.resourceName); return compare1 != 0 ? compare1 : this.resourceItemId.compareTo(o.resourceItemId); } @SuppressWarnings("unused") private  ResourceItemCommonDataId();  ResourceItemCommonDataId(String resourceName, String resourceItemId); @Override int compareTo(ResourceItemCommonDataId o); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); String getResourceName(); String getResourceItemId();  }
@Test public void testCompareToResourceItemCommonDataId() { ResourceItemCommonDataId target = new ResourceItemCommonDataId("b", "2"); ResourceItemCommonDataId gt1 = new ResourceItemCommonDataId("a", "2"); ResourceItemCommonDataId gt2 = new ResourceItemCommonDataId("b", "1"); ResourceItemCommonDataId eq = new ResourceItemCommonDataId("b", "2"); ResourceItemCommonDataId lt1 = new ResourceItemCommonDataId("b", "3"); ResourceItemCommonDataId lt2 = new ResourceItemCommonDataId("c", "1"); assertThat(target.compareTo(gt1) > 0, is(true)); assertThat(target.compareTo(gt2) > 0, is(true)); assertThat(target.compareTo(eq) == 0, is(true)); assertThat(target.compareTo(lt1) < 0, is(true)); assertThat(target.compareTo(lt2) < 0, is(true)); }