CheckUtilities { public static boolean checkUnorderedListsEqual(List<?> l1, List<?> l2) { if (null == l1 && null != l2) { return false; } if (null != l1 && null == l2) { return false; } if (l1.size() != l2.size()) { return false; } for (Object o : l1) { if (!l2.contains(o)) { return false; } } for (Object o : l2) { if (!l1.contains(o)) { 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 testCheckUnorderedListsEqual() { List<String> l1 = new ArrayList<String>(); List<String> l2 = null; assertTrue(!CheckUtilities.checkUnorderedListsEqual(l1, l2)); l1 = null; l2 = new ArrayList<String>(); assertTrue(!CheckUtilities.checkUnorderedListsEqual(l1, l2)); l1 = new ArrayList<String>(); l1.add("str"); assertTrue(!CheckUtilities.checkUnorderedListsEqual(l1, l2)); String s = "st"; s += "r"; l2.add(s); l2.add("Bing Bop"); assertTrue(!CheckUtilities.checkUnorderedListsEqual(l1, l2)); s = "Bing"; l1.add(s); assertTrue(!CheckUtilities.checkUnorderedListsEqual(l1, l2)); l1.remove(1); s += " Bop"; l1.add(s); assertTrue(CheckUtilities.checkUnorderedListsEqual(l1, l2)); }