### Question:
ParamChecker { public static <T> List<T> notNulls(List<T> l, String paramName) { notNull(l, paramName); for (T t : l) { if (t == null) { throw new IllegalArgumentException(paramName + " cannot have NULL elements"); } } return l; }  static T notNull(T t, String paramName); static String notEmpty(String s, String paramName); static List<T> notNulls(List<T> l, String paramName); static int greaterEqualZero(int i, String paramName); static int greaterThan(int i, int base, String paramName); static long greaterEqualZero(long i, String paramName); static long greaterThan(long i, long base, String paramName); static void asserts(boolean b, String msg);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testNotNullsOK() { List l = new ArrayList(); Assert.assertSame(l, ParamChecker.notNulls(l, "l")); l.add(new Object()); Assert.assertSame(l, ParamChecker.notNulls(l, "l")); }
@Test(expected = IllegalArgumentException.class) public void testNotNullsFail1() { ParamChecker.notNulls(null, "l"); }
@Test(expected = IllegalArgumentException.class) @SuppressWarnings("unchecked") public void testNotNullsFail2() { List l = new ArrayList(); l.add(null); ParamChecker.notNulls(l, "l"); }