### Question:
InputValidator { public boolean validateNotNull( final String input, final String label ) { return validateNotNull( input, label, STANDARD ); } InputValidator( final String form, final Context context ); boolean validateNotNull( final String input, final String label ); boolean validateNotNull( final String input, final String label, final int type ); boolean validate( final String input, final String label, final int type ); static boolean isBlank( final String input ); static final int STANDARD; static final int EMAIL; static final int ID; }### Answer:
@Test public void testValidateNotNull() { Assertions.assertTrue( val.validateNotNull("Test string", "Name") ); Assertions.assertFalse( val.validateNotNull("Test $tring", "Name") ); Assertions.assertFalse( val.validateNotNull("", "Name") ); Assertions.assertFalse( val.validateNotNull(null, "Name") ); }
@Test public void testValidateEmail() { Assertions.assertTrue( val.validateNotNull("foo@bar.com", "E-mail", InputValidator.EMAIL) ); Assertions.assertTrue( val.validateNotNull("foo-bar@foo.com", "E-mail", InputValidator.EMAIL) ); Assertions.assertTrue( val.validateNotNull("foo-bar@foo.co.uk", "E-mail", InputValidator.EMAIL) ); Assertions.assertTrue( val.validateNotNull("foo+bar@foo.co.uk", "E-mail", InputValidator.EMAIL) ); Assertions.assertTrue( val.validateNotNull("foo.bar@foo.co.uk", "E-mail", InputValidator.EMAIL) ); Assertions.assertFalse( val.validateNotNull("foobar", "E-mail", InputValidator.EMAIL) ); Assertions.assertFalse( val.validateNotNull("foobar@foo", "E-mail", InputValidator.EMAIL) ); }