### Question:
ViewVersionResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> subResourceDefinitions = new HashSet<>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewInstance)); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewPermission)); return subResourceDefinitions; } ViewVersionResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions();  }### Answer:
@Test public void testGetSubResourceDefinitions() throws Exception { ViewVersionResourceDefinition viewVersionResourceDefinition = new ViewVersionResourceDefinition(); Set<SubResourceDefinition> subResourceDefinitions = viewVersionResourceDefinition.getSubResourceDefinitions (); Assert.assertEquals(2, subResourceDefinitions.size()); for (SubResourceDefinition subResourceDefinition : subResourceDefinitions) { String name = subResourceDefinition.getType().name(); Assert.assertTrue(name.equals("ViewInstance") || name.equals("ViewPermission")); } }