### Question:
ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyDispatcher propertyDispatcher,
            Handler modelChanged, List<LinkkiAspectDefinition> aspectDefinitions); PropertyDispatcher getPropertyDispatcher(); @Override void updateFromPmo(); @Override Object getBoundComponent(); @Override @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "because that's what requireNonNull is for") Object getPmo(); @Override MessageList displayMessages(MessageList messages); @Override String toString();  }### Answer:
@Test public void testDisplayMessages() { messageList.add(Message.newError("code", "text")); selectBinding.displayMessages(messageList); @NonNull MessageList validationMessages = selectField.getValidationMessages(); assertThat(validationMessages, hasErrorMessage("code")); Message firstMessage = validationMessages.getFirstMessage(Severity.ERROR).get(); assertEquals(firstMessage.getText(), "text"); }
@Test public void testDisplayMessages_noMessages() { selectBinding.displayMessages(messageList); assertThat(selectField.getValidationMessages(), is(emptyMessageList())); }
@Test public void testDisplayMessages_noMessageList() { Assertions.assertThrows(NullPointerException.class, () -> { selectBinding.displayMessages(null); }); }