RepositoryVersionResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { return Collections.singleton(new SubResourceDefinition(Resource.Type.OperatingSystem)); } RepositoryVersionResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions();  }
@Test public void testGetSubResourceDefinitions() throws Exception { final RepositoryVersionResourceDefinition resourceDefinition = new RepositoryVersionResourceDefinition(); final Set<SubResourceDefinition> subResourceDefinitions = resourceDefinition.getSubResourceDefinitions (); final Iterator<SubResourceDefinition> iterator = subResourceDefinitions.iterator(); Assert.assertEquals(Resource.Type.OperatingSystem, iterator.next().getType()); Assert.assertEquals(1, subResourceDefinitions.size()); }