UserResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { final Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.UserPrivilege)); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ActiveWidgetLayout)); return subResourceDefinitions; } UserResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions();  }
@Test public void testGetSubResourceDefinitions() throws Exception { final UserResourceDefinition userResourceDefinition = new UserResourceDefinition(); Set<SubResourceDefinition> subResourceDefinitions = userResourceDefinition.getSubResourceDefinitions(); Assert.assertEquals(2, subResourceDefinitions.size()); }