@Test public void testCompare() { int check; String testString_1 = new String("TestString_01"); String testString_2 = new String("TestString_01"); String testString_3 = new String("TestString_02"); check = ObjectUtil.compare(testString_1, testString_2); assertThat(check, is(equalTo(0))); check = ObjectUtil.compare(testString_1, testString_3); assertThat(check, is(lessThan(0))); check = ObjectUtil.compare(testString_3, testString_1); assertThat(check, is(greaterThan(0))); check = ObjectUtil.compare(null, null); assertNotNull(check); }
public static <T extends Comparable<T>> int compare(T obj0, T obj1) { if (obj0 == null) { if (obj1 == null) { return 0; } return 1; } if (obj1 == null) { return -1; } return obj0.compareTo(obj1); }
ObjectUtil { public static <T extends Comparable<T>> int compare(T obj0, T obj1) { if (obj0 == null) { if (obj1 == null) { return 0; } return 1; } if (obj1 == null) { return -1; } return obj0.compareTo(obj1); } }
ObjectUtil { public static <T extends Comparable<T>> int compare(T obj0, T obj1) { if (obj0 == null) { if (obj1 == null) { return 0; } return 1; } if (obj1 == null) { return -1; } return obj0.compareTo(obj1); } private  ObjectUtil(); }
ObjectUtil { public static <T extends Comparable<T>> int compare(T obj0, T obj1) { if (obj0 == null) { if (obj1 == null) { return 0; } return 1; } if (obj1 == null) { return -1; } return obj0.compareTo(obj1); } private  ObjectUtil(); static int compare(T obj0, T obj1); }
ObjectUtil { public static <T extends Comparable<T>> int compare(T obj0, T obj1) { if (obj0 == null) { if (obj1 == null) { return 0; } return 1; } if (obj1 == null) { return -1; } return obj0.compareTo(obj1); } private  ObjectUtil(); static int compare(T obj0, T obj1);  }