CommonModalBuilder { public CommonModalBuilder addBody(HTMLElement element) { this.getModal().add(buildPanel(element, makeModalBody())); 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 testAddBody() { final HTMLElement htmlElement = mock(HTMLElement.class); final FlowPanel flowPanel = mock(FlowPanel.class); final ModalBody modalBody = mock(ModalBody.class); doReturn(modalMock).when(builder).getModal(); doReturn(modalBody).when(builder).makeModalBody(); doReturn(flowPanel).when(builder).buildPanel(htmlElement, modalBody); builder.addBody(htmlElement); verify(modalMock).add(flowPanel); }