### Question:
ServiceResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> subs = new HashSet<>(); subs.add(new SubResourceDefinition(Resource.Type.Component)); subs.add(new SubResourceDefinition(Resource.Type.Alert)); subs.add(new SubResourceDefinition(Resource.Type.Artifact)); return subs; } ServiceResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions();  }### Answer:
@Test public void testGetSubResourceDefinitions() { ResourceDefinition resource = new ServiceResourceDefinition(); Set<SubResourceDefinition> subResources = resource.getSubResourceDefinitions(); assertEquals(3, subResources.size()); assertTrue(includesType(subResources, Resource.Type.Component)); assertTrue(includesType(subResources, Resource.Type.Alert)); assertTrue(includesType(subResources, Resource.Type.Artifact)); }