### Question:
MappingEntryValidationImpl extends AbstractValidation<MappingEntry> implements MappingEntryValidation { @Override protected void validate(ValidationContext<MappingEntry> context) { validateNotNull(context); if (context.isInValid()) { return; } MappingEntry mappingEntry = context.objectToValidate; context.result.addErrors(patternValidation.validate(mappingEntry.getPattern())); context.result.addErrors(replaceValidation.validate(mappingEntry.getReplacement())); context.result.addErrors(commentValidation.validate(mappingEntry.getComment())); }    }### Answer:
@Test public void all_set_with_valid_content_nothing_wrong() { assertTrue(validationToTest.validate(new MappingEntry("something.as.id", "replacement", "comment")).isValid()); assertTrue(validationToTest.validate(new MappingEntry("", "", "")).isValid()); }
@Test public void one_null_means_wrong() { assertFalse(validationToTest.validate(new MappingEntry(null, "", "")).isValid()); assertFalse(validationToTest.validate(new MappingEntry("", null, "")).isValid()); assertFalse(validationToTest.validate(new MappingEntry("", "", null)).isValid()); }
@Test public void all_null_means_wrong() { assertFalse(validationToTest.validate(new MappingEntry(null, null, null)).isValid()); assertFalse(validationToTest.validate(new MappingEntry()).isValid()); }
@Test public void check_80_chars_limit_for_id() { assertTrue(validationToTest.validate(new MappingEntry(CONST_80_CHARS, "", "")).isValid()); assertFalse(validationToTest.validate(new MappingEntry(CONST_80_CHARS+"1", "", "")).isValid()); }
@Test public void check_80_chars_limit_for_replacement() { assertTrue(validationToTest.validate(new MappingEntry("", CONST_80_CHARS,"")).isValid()); assertFalse(validationToTest.validate(new MappingEntry("", CONST_80_CHARS+"1","")).isValid()); }
@Test public void check_80_chars_limit_for_comment() { assertTrue(validationToTest.validate(new MappingEntry("", "", CONST_80_CHARS)).isValid()); assertFalse(validationToTest.validate(new MappingEntry("", "", CONST_80_CHARS+"1")).isValid()); }