DataValidation { public static boolean validateLength(String input, int minimum, int maximum) { return input.length() >= minimum && input.length() <= maximum; }  static boolean validateLength(String input, int minimum, int maximum);  }
@Test public void testGoodLength() { String s = "hello"; assertTrue(DataValidation.validateLength(s, 4, 5)); assertTrue(DataValidation.validateLength(s, 5, 6)); assertTrue(DataValidation.validateLength(s, 5, 5)); assertTrue(DataValidation.validateLength(s, 4, 6)); }
@Test public void testBadLength() { String s = "hello"; assertFalse(DataValidation.validateLength(s, 0, 4)); assertFalse(DataValidation.validateLength(s, 6, 100)); }