CheckUtilities { public static void checkIntArgumentGreaterThan(int toCheck, int lowerBound, String variableName) { if (lowerBound >= toCheck) { throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000004") + " { toCheck=[" + toCheck + "], lowerBound=[" + lowerBound + "], variableName=[" + variableName + "] }"); } }  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 testCheckIntArgumentGreaterThan() { assertCheckIntArgumentGreaterThanThrowsException(5, 5, "Test variable name", "000004: The int argument is not greater than the lower bound (lowerBound < toCheck). " + "{ toCheck=[5], lowerBound=[5], variableName=[Test variable name] }"); assertCheckIntArgumentGreaterThanThrowsException(5, 6, "Test variable name", "000004: The int argument is not greater than the lower bound (lowerBound < toCheck). " + "{ toCheck=[5], lowerBound=[6], variableName=[Test variable name] }"); try { CheckUtilities.checkIntArgumentGreaterThan(5, 4, "Test variable name"); } catch (IllegalArgumentException e) { e.printStackTrace(); assertTrue("Caught IllegalArgumentException when none was expected. Error!", false); } }