ArgumentChecker { public static String notEmpty(String parameter, String name) { notNull(parameter, name); if (parameter.length() == 0) { throw new IllegalArgumentException("Input parameter '" + name + "' must not be empty"); } return parameter; } private  ArgumentChecker(); static void isTrue(boolean validIfTrue, String message); static void isTrue(boolean validIfTrue, String message, Object... arg); static void isFalse(boolean validIfFalse, String message); static void isFalse(boolean validIfFalse, String message, Object... arg); static T notNull(T parameter, String name); static T notNullInjected(T parameter, String name); static String notBlank(String parameter, String name); static String notEmpty(String parameter, String name); static T[] notEmpty(T[] parameter, String name); static int[] notEmpty(int[] parameter, String name); static long[] notEmpty(long[] parameter, String name); static double[] notEmpty(double[] parameter, String name); static I notEmpty(I parameter, String name); static C notEmpty(C parameter, String name); static M notEmpty(M parameter, String name); static T[] noNulls(T[] parameter, String name); static I noNulls(I parameter, String name); static M noNulls(M parameter, String name); static int notNegative(int parameter, String name); static long notNegative(long parameter, String name); static double notNegative(double parameter, String name); static int notNegativeOrZero(int parameter, String name); static long notNegativeOrZero(long parameter, String name); static double notNegativeOrZero(double parameter, String name); static double notNegativeOrZero(double parameter, double eps, String name); @Deprecated static double notNegativeOrZero(double parameter, double eps, String message, Object... args); static double notZero(double parameter, double eps, String name); static boolean hasNullElement(Iterable<?> iterable); static boolean hasNegativeElement(Iterable<Double> iterable); static boolean isInRangeExclusive(double low, double high, double value); static boolean isInRangeInclusive(double low, double high, double value); static boolean isInRangeExcludingLow(double low, double high, double value); static boolean isInRangeExcludingHigh(double low, double high, double value); static void inOrderOrEqual(Comparable<? super T> obj1, T obj2, String param1, String param2);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_String_null() { String str = null; try { ArgumentChecker.notEmpty(str, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_String_empty() { String str = ""; try { ArgumentChecker.notEmpty(str, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Array_null() { Object[] array = null; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Array_empty() { Object[] array = new Object[] {}; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_2DArray_null() { Object[][] array = null; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_2DArray_empty() { Object[][] array = new Object[0][0]; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_intArray_null() { int[] array = null; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_intArray_empty() { int[] array = new int[0]; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_longArray_null() { long[] array = null; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_longArray_empty() { long[] array = new long[0]; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_doubleArray_null() { double[] array = null; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_doubleArray_empty() { double[] array = new double[0]; try { ArgumentChecker.notEmpty(array, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Iterable_null() { Iterable<?> coll = null; try { ArgumentChecker.notEmpty(coll, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Iterable_empty() { Iterable<?> coll = Collections.emptyList(); try { ArgumentChecker.notEmpty(coll, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Collection_null() { Collection<?> coll = null; try { ArgumentChecker.notEmpty(coll, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Collection_empty() { Collection<?> coll = Collections.emptyList(); try { ArgumentChecker.notEmpty(coll, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Map_null() { Map<?, ?> map = null; try { ArgumentChecker.notEmpty(map, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void test_notEmpty_Map_empty() { Map<?, ?> map = Collections.emptyMap(); try { ArgumentChecker.notEmpty(map, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNotEmptyDoubleArray() { double[] d = new double[0]; try { ArgumentChecker.notEmpty(d, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNotEmptyLongArray() { double[] d = new double[0]; try { ArgumentChecker.notEmpty(d, "name"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage().contains("'name'"), true); throw ex; } }