public void shouldFindPublicChildNodeDefinitionsWhenBothPublicAndProtectedAreDefined() throws Exception {
InputStream cndStream = getClass().getResourceAsStream("/cnd/protectedDefinitions.cnd");
assertThat(cndStream, is(notNullValue()));
nodeTypeManager().registerNodeTypes(cndStream, true);
Name parking = new BasicName(null, "parking");
Name level = new BasicName(null, "level");
Set<Name> garage = Collections.<Name>singleton(new BasicName(null, "garage"));
JcrNodeDefinition def = repoTypeManager.getNodeTypes().findChildNodeDefinitions(parking, garage)
.findBestDefinitionForChild(level, level, true, SiblingCounter.noSiblings());
assertNotNull(def);
Name car = new BasicName(null, "car");
def = repoTypeManager.getNodeTypes().findChildNodeDefinitions(parking, garage)
.findBestDefinitionForChild(car, car, true, SiblingCounter.noSiblings());
assertNotNull(def);
}