### Question:
FlashMessagesView implements FlashMessages.View { void setupDisableErrorHighlightCallbacks(final Element element) { element.onkeypress = (e) -> { disableErrorHighlight(element); return true; }; element.onblur = (e) -> { disableErrorHighlight(element); return true; }; } @Inject  FlashMessagesView(final HTMLDivElement errorContainer,
                             final HTMLDivElement warningContainer,
                             final @Named("strong") HTMLElement strongErrorMessage,
                             final @Named("span") HTMLElement regularErrorMessage,
                             final @Named("strong") HTMLElement strongWarningMessage,
                             final @Named("span") HTMLElement regularWarningMessage,
                             final HTMLButtonElement okWarningButton,
                             final HTMLButtonElement cancelWarningButton,
                             final HTMLButtonElement closeSuccessButton,
                             final HTMLDivElement successContainer,
                             final @Named("strong") HTMLElement strongSuccessMessage,
                             final @Named("span") HTMLElement regularSuccessMessage); @Override void init(final FlashMessages presenter); @EventHandler("close-success-message-button") void onCloseSuccessButtonClick(final ClickEvent e); @EventHandler("ok-warning-button") void onOkWarningButtonClick(final ClickEvent e); @EventHandler("cancel-warning-button") void onCancelWarningButtonClick(final ClickEvent e); @Override void showErrorMessage(final String strongMessage,
                                 final String regularMessage); @Override void showWarningMessage(final String strongMessage,
                                   final String regularMessage); @Override void showSuccessMessage(final String strongMessage,
                                   final String regularMessage); @Override void showErrorHighlight(final String errorElementSelector); @Override void showWarningHighlight(final String warningElementSelector); @Override boolean isElementPresent(final String elementSelector); @Override void hideWarningContainer(); @Override void hideSuccessContainer(); @Override void hideErrorContainer();  }### Answer:
@Test public void testSetupDisableErrorHighlightCallbacks() { final Event event = mock(Event.class); final Element errorElement = mock(Element.class); doNothing().when(view).disableErrorHighlight(any()); view.setupDisableErrorHighlightCallbacks(errorElement); errorElement.onkeypress.onInvoke(event); errorElement.onblur.onInvoke(event); verify(view, times(2)).disableErrorHighlight(errorElement); }