ValidationUtils { public static int assertIsPositive(int num, String fieldName) { if (num <= 0) { throw new IllegalArgumentException(String.format("%s must be positive", fieldName)); } return num; }  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 assertIsPositive_PositiveNumber_ReturnsSameNumber() { assertEquals(42, ValidationUtils.assertIsPositive(42, "num")); }
@Test(expected = IllegalArgumentException.class) public void assertIsPositive_Zero_ThrowsException() { ValidationUtils.assertIsPositive(0, "num"); }
@Test(expected = IllegalArgumentException.class) public void assertIsPositive_NegativeNumber_ThrowsException() { ValidationUtils.assertIsPositive(-9001, "num"); }