Validators { public static IValidator<String> isInteger() { return value -> { try { Integer.parseInt(value); return true; } catch (NumberFormatException ex) { return false; } }; }  static IValidator<String> isNotEmpty(); static IValidator<String> isInteger(); static IValidator<String> isIntegerOrBlank(); static IValidator<String> isDouble();  }
@Test public void isIntegerWithNull() { assertFalse(isInteger().isValid(null)); }
@Test public void isIntegerWithEmptyString() { assertFalse(isInteger().isValid("")); }
@Test public void isIntegerWithText() { assertFalse(isInteger().isValid("Test")); }
@Test public void isIntegerWithOnlySpaces() { assertFalse(isInteger().isValid(" ")); }
@Test public void isIntegerWithNumberAndSpace() { assertFalse(isInteger().isValid("12 ")); }
@Test public void isIntegerWithDouble() { assertFalse(isInteger().isValid("10.2")); }
@Test public void isIntegerWithInteger() { assertTrue(isInteger().isValid("10")); }