### Question:
EmailValidationService { public boolean checkEmail(final DataDefinition dataDefinition, final FieldDefinition fieldDefinition, final Entity entity, final Object oldValue, final Object newValue) { if (newValue == null || newValue.toString().isEmpty()) { return true; } return MailServiceImpl.isValidEmail(newValue.toString()); }  boolean checkEmail(final DataDefinition dataDefinition, final FieldDefinition fieldDefinition, final Entity entity,
            final Object oldValue, final Object newValue);  }### Answer:
@Test public final void shouldPassNullEmail() throws Exception { newValue = null; boolean result = emailValidationService.checkEmail(dataDefinition, fieldDefinition, entity, oldValue, newValue); Assert.assertTrue(result); }
@Test public final void shouldPassEmptyEmail() throws Exception { newValue = ""; boolean result = emailValidationService.checkEmail(dataDefinition, fieldDefinition, entity, oldValue, newValue); Assert.assertTrue(result); }
@Test public final void shouldPassValidEmail() throws Exception { newValue = "some.email@qcadoo.com"; boolean result = emailValidationService.checkEmail(dataDefinition, fieldDefinition, entity, oldValue, newValue); Assert.assertTrue(result); }
@Test public final void shouldNotPassBlankEmail() throws Exception { newValue = " "; boolean result = emailValidationService.checkEmail(dataDefinition, fieldDefinition, entity, oldValue, newValue); Assert.assertFalse(result); }
@Test public final void shouldNotPassLocalEmail() throws Exception { newValue = "some.email@192.168.0.1"; boolean result = emailValidationService.checkEmail(dataDefinition, fieldDefinition, entity, oldValue, newValue); Assert.assertFalse(result); }
@Test public final void shouldNotPassInvalidEmail() throws Exception { newValue = "invalid$email.com"; boolean result = emailValidationService.checkEmail(dataDefinition, fieldDefinition, entity, oldValue, newValue); Assert.assertFalse(result); }