PropertyEditorHelper { static void createCategory(final PropertyEditorWidget propertyEditorWidget, final PanelGroup propertyMenu, final PropertyEditorCategory category, final String propertyNameFilter) { Panel panel = GWT.create(Panel.class); PanelCollapse panelCollapse = createPanelCollapse(propertyEditorWidget, category); PanelHeader headerPanel = createPanelHeader(category, propertyMenu, panelCollapse); PanelBody panelBody = createPanelBody(); Form form = createPanelContent(panelBody); boolean categoryHasActiveChilds = false; for (final PropertyEditorFieldInfo field : category.getFields()) { if (isAMatchOfFilter(propertyNameFilter, field)) { categoryHasActiveChilds = true; form.add(createItemsWidget(field, category, form)); } } if (categoryHasActiveChilds) { panelCollapse.add(panelBody); panel.add(headerPanel); panel.add(panelCollapse); propertyMenu.add(panel); } }  static void extractEditorFrom(final PropertyEditorWidget propertyEditorWidget,
                                         final PanelGroup propertyMenu,
                                         final PropertyEditorEvent event,
                                         final String propertyNameFilter); static void extractEditorFrom(final PropertyEditorWidget propertyEditorWidget,
                                         final PanelGroup propertyMenu,
                                         final PropertyEditorEvent event); static boolean validade(PropertyEditorEvent event);  }
@Test public void createCategoryWithNoFields() { PropertyEditorWidget propertyEditorWidget = GWT.create(PropertyEditorWidget.class); PanelGroup propertyMenu = GWT.create(PanelGroup.class); PropertyEditorCategory category = new PropertyEditorCategory("1"); PropertyEditorHelper.createCategory(propertyEditorWidget, propertyMenu, category, ""); verify(propertyMenu, never()).add(any(Widget.class)); }