CommonModalBuilder { public CommonModalBuilder addFooter(ModalFooter footer) { this.getModal().add(footer); return this; } CommonModalBuilder(); CommonModalBuilder addHeader(String title); CommonModalBuilder addBody(HTMLElement element); CommonModalBuilder addBody(elemental2.dom.HTMLElement element); CommonModalBuilder addFooter(ModalFooter footer); CommonModalBuilder addFooter(HTMLElement element); CommonModalBuilder addFooter(final elemental2.dom.HTMLElement htmlElement); BaseModal build();  }
@Test public void testAddFooter() { final HTMLElement htmlElement = mock(HTMLElement.class); final FlowPanel flowPanel = mock(FlowPanel.class); final ModalFooter modalFooter = mock(ModalFooter.class); doReturn(modalMock).when(builder).getModal(); doReturn(modalFooter).when(builder).makeModalFooter(); doReturn(flowPanel).when(builder).buildPanel(htmlElement, modalFooter); builder.addFooter(htmlElement); verify(modalMock).add(flowPanel); }