### Question:
Message implements Serializable { public boolean isMandatoryFieldMessage() { return getMarkers() .stream() .anyMatch(ValidationMarker::isRequiredInformationMissing); } Message(@CheckForNull String code, String text, Severity severity);   Message(@CheckForNull String code, String text, Severity severity,
            @CheckForNull List<ObjectProperty> invalidObjectProperties, @CheckForNull Set<ValidationMarker> markers); static Message newInfo(String code, String text); static Message newWarning(String code, String text); static Message newError(String code, String text); Severity getSeverity(); String getText(); @CheckForNull String getCode(); List<ObjectProperty> getInvalidObjectProperties(); Set<ValidationMarker> getMarkers(); boolean hasMarker(ValidationMarker marker); boolean hasMarkers(); boolean isMandatoryFieldMessage(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static Builder builder(String text, Severity severity);  }### Answer:
@Test public void testIsMandatoryFieldMessage() { ValidationMarker mandatoryMarker = () -> true; ValidationMarker notMandatoryMarker = () -> false; assertThat(createMessage().isMandatoryFieldMessage(), is(false)); assertThat(createMessage(notMandatoryMarker).isMandatoryFieldMessage(), is(false)); assertThat(createMessage(mandatoryMarker).isMandatoryFieldMessage(), is(true)); assertThat(createMessage(notMandatoryMarker, mandatoryMarker).isMandatoryFieldMessage(), is(true)); }