class EmailValidator {

  public boolean validate(final String hex) {

    matcher = pattern.matcher(hex);
    return matcher.matches();
  }

}

class EmailValidatorTest {

  private EmailValidator tested;

  @Test
  public void testValidate_invalidEmail() throws Exception {

    assertThat(tested.validate("foo")).isFalse();
    assertThat(tested.validate("foo@")).isFalse();
    assertThat(tested.validate("foo@gmail")).isFalse();
  }

}