ValidationUtils { public static void assertAllAreNull(String messageIfNull, Object... objects) throws IllegalArgumentException { for (Object object : objects) { if (object != null) { throw new IllegalArgumentException(messageIfNull); } } }  static T assertNotNull(T object, String fieldName); static void assertAllAreNull(String messageIfNull, Object... objects); static int assertIsPositive(int num, String fieldName); static T assertNotEmpty(T collection, String fieldName); static T[] assertNotEmpty(T[] array, String fieldName); static String assertStringNotEmpty(String string, String fieldName);  }
@Test public void assertAllAreNull_AllNull_DoesNotThrow() { ValidationUtils.assertAllAreNull("foo", null, null, null); }
@Test(expected = IllegalArgumentException.class) public void assertAllAreNull_SomeNull_ThrowsException() { ValidationUtils.assertAllAreNull("foo", null, "non-null", null, null); }
@Test public void assertAllAreNull_NoneProvided_DoesNotThrow() { ValidationUtils.assertAllAreNull("foo"); }