CheckUtilities { public static boolean checkObjectsEqual(Object o1, Object o2) { if (null != o1 && !o1.equals(o2)) { return false; } if (null == o1 && null != o2) { return false; } return true; }  static void checkFileValidity(String filename); static void checkFileValidity(File file); static void checkIntArgumentGreaterThan(int toCheck, int lowerBound, String variableName); static void checkNullArgument(Object obj, String variableName); static void checkNullListArgument(List<?> list, String variableName); static boolean checkListsEqual(List<?> l1, List<?> l2); static boolean checkObjectsEqual(Object o1, Object o2); static void checkStringArgument(String str, String variableName); static void checkStringListArgument(List<String> str, String variableName); static boolean checkUnorderedListsEqual(List<?> l1, List<?> l2); static void checkIntIndexInListRange(List<?> list, int index); static void checkIntInRange(int index, int start, int end); static void validateListRefType(List<Ref> list, Ref.RefType type, String variableName); static void validateArgumentRefType(Ref name, Ref.RefType type, String variableName); static void checkDirectoryArgument(File fileName, String variableName);  }
@Test public void testCheckObjectEquals() { String s1 = "test me!"; String s2 = null; assertTrue(!CheckUtilities.checkObjectsEqual(s1, s2)); s2 = "test"; assertTrue(!CheckUtilities.checkObjectsEqual(s1, s2)); s1 = null; assertTrue(!CheckUtilities.checkObjectsEqual(s1, s2)); s1 = "test me!"; s2 += " me!"; assertTrue(CheckUtilities.checkObjectsEqual(s1, s2)); }