PropertyEditorHelper { public static boolean validade(PropertyEditorEvent event) { if (event == null) { throw new NullEventException("Event should not be null,"); } if (event.getSortedProperties().isEmpty()) { throw new NoPropertiesException("Event should not have empty properties."); } return event != null && !event.getSortedProperties().isEmpty(); }  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(expected = PropertyEditorHelper.NullEventException.class) public void validateNullEventTest() { PropertyEditorHelper.validade(null); }
@Test(expected = PropertyEditorHelper.NoPropertiesException.class) public void validateEventWithNoPropertiesTest() { PropertyEditorEvent event = new PropertyEditorEvent("id", new ArrayList<PropertyEditorCategory>()); PropertyEditorHelper.validade(event); }
@Test public void validateEventTest() { ArrayList<PropertyEditorCategory> properties = new ArrayList<PropertyEditorCategory>(); properties.add(new PropertyEditorCategory("Category")); PropertyEditorEvent event = new PropertyEditorEvent("id", properties); assertTrue(PropertyEditorHelper.validade(event)); }