### Question:
UserResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { final Set<SubResourceDefinition> subResourceDefinitions = new HashSet<>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.UserAuthenticationSource)); 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();  }### Answer:
@Test public void testGetSubResourceDefinitions() throws Exception { Set<Resource.Type> expectedSubResourceDefinitionTypes = new HashSet<>(); expectedSubResourceDefinitionTypes.add(Resource.Type.UserAuthenticationSource); expectedSubResourceDefinitionTypes.add(Resource.Type.UserPrivilege); expectedSubResourceDefinitionTypes.add(Resource.Type.ActiveWidgetLayout); final UserResourceDefinition userResourceDefinition = new UserResourceDefinition(); Set<SubResourceDefinition> subResourceDefinitions = userResourceDefinition.getSubResourceDefinitions(); Assert.assertEquals(expectedSubResourceDefinitionTypes.size(), subResourceDefinitions.size()); for(SubResourceDefinition subResourceDefinition : subResourceDefinitions) { Assert.assertTrue(expectedSubResourceDefinitionTypes.contains(subResourceDefinition.getType())); } }