### Question:
FlashMessages { public HTMLElement getElement() { return view.getElement(); } @Inject  FlashMessages(final View view); HTMLElement getElement(); void onFlashMessageEvent(final @Observes FlashMessage flashMessage); void hideMessages();  }### Answer:
@Test public void testGetElement() { final HTMLElement expectedHTMLElement = mock(HTMLElement.class); when(view.getElement()).thenReturn(expectedHTMLElement); final HTMLElement actualHTMLElement = flashMessages.getElement(); assertEquals(expectedHTMLElement, actualHTMLElement); }