ViewInstanceResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { return subResourceDefinitions; } ViewInstanceResourceDefinition(Set<SubResourceDefinition> subResourceDefinitions); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions();  }
@Test public void testGetSubResourceDefinitions() throws Exception { ViewInstanceResourceDefinition viewInstanceResourceDefinition = getViewInstanceResourceDefinition(); Set<SubResourceDefinition> subResourceDefinitions = viewInstanceResourceDefinition.getSubResourceDefinitions(); Assert.assertEquals(3, subResourceDefinitions.size()); for (SubResourceDefinition subResourceDefinition : subResourceDefinitions) { Resource.Type type = subResourceDefinition.getType(); Assert.assertTrue(type.name().equals("sub1") || type.name().equals("sub2") || type.equals(Resource.Type.ViewPrivilege)); } }