FormStyleLayout extends Form { public FormStyleItem addAttribute(String label, IsWidget widget) { final FormStyleItem formStyleItem = GWT.create(FormStyleItem.class); formStyleItem.setup(label, widget, getWidgetCount()); add(formStyleItem); return formStyleItem; } FormStyleLayout();  FormStyleLayout(final String title);  FormStyleLayout(final Image icon,
                           final String title); FormStyleItem addAttribute(String label,
                                      IsWidget widget); FormStyleItem addAttribute(final String label,
                                      final String helpTitle,
                                      final String helpContent,
                                      final IsWidget widget); int addRow(final IsWidget widget); void setAttributeVisibility(final int index,
                                       final boolean b);  }
@Test public void testAddAttributeWithHelp() throws Exception { final String attribute = "form attribute"; final String helpTitle = "help title"; final String helpContent = "help content"; final IsWidget widget = mock(IsWidget.class); final int widgetCount = 123; doReturn(widgetCount).when(testedLayout).getWidgetCount(); testedLayout.addAttribute(attribute, helpTitle, helpContent, widget); verify(item).setup(attribute, helpTitle, helpContent, widget, widgetCount); verify(testedLayout).add(item); }