UserDetail implements Serializable, Comparable<UserDetail> { @Override public int compareTo(UserDetail o) { return script.compareTo(o.script); } UserDetail();  UserDetail(String script, Integer users); String getScript(); Integer getUsers(); Date getCreateTime(); @Override int compareTo(UserDetail o); @Override String toString();  }
@Test public void testCompareTo_1() throws Exception { UserDetail fixture = new UserDetail("", new Integer(1)); UserDetail o = new UserDetail("", new Integer(1)); int result = fixture.compareTo(o); assertEquals(0, result); }