docs: List<JcrNodeDefinition> findChildNodeDefinitions( List<Name> typeNamesToCheck,
                                                        Name childNodeName,
                                                        NodeCardinality typesToCheck,
                                                        List<JcrNodeType> pendingTypes ) {
          assert typeNamesToCheck != null;
          Collection<JcrNodeDefinition> nodeDefs = null;
          List<JcrNodeDefinition> matchingDefs = new ArrayList<JcrNodeDefinition>();
  
          for (Name typeNameToCheck : typeNamesToCheck) {
              JcrNodeType typeName = findTypeInMapOrList(typeNameToCheck, pendingTypes);
              if (typeName == null) continue;
  
              switch (typesToCheck) {
                  case NO_SAME_NAME_SIBLINGS:
                      nodeDefs = typeName.allChildNodeDefinitions(childNodeName, false);
                      break;
                  case SAME_NAME_SIBLINGS:
                      nodeDefs = typeName.allChildNodeDefinitions(childNodeName, true);
                      break;
                  case ANY:
                      nodeDefs = typeName.allChildNodeDefinitions(childNodeName);
                      break;
              }
  
              assert nodeDefs != null;
              for (JcrNodeDefinition definition : nodeDefs) {
                  if (NodeCardinality.NO_SAME_NAME_SIBLINGS == typesToCheck && definition.allowsSameNameSiblings()) continue;
                  matchingDefs.add(definition);
              }
          }
  
          return matchingDefs;
      }