code: List<JcrPropertyDefinition> findPropertyDefinitions( List<Name> typeNamesToCheck,
                                                           Name propertyName,
                                                           PropertyCardinality typeToCheck,
                                                           List<JcrNodeType> pendingTypes ) {
          assert typeNamesToCheck != null;
  
          Collection<JcrPropertyDefinition> propDefs = null;
          List<JcrPropertyDefinition> matchingDefs = new ArrayList<JcrPropertyDefinition>();
  
          // Look for a single-value property definition on the mixin types that matches by name and type ...
          for (Name typeNameToCheck : typeNamesToCheck) {
              JcrNodeType typeName = findTypeInMapOrList(typeNameToCheck, pendingTypes);
              if (typeName == null) continue;
  
              switch (typeToCheck) {
                  case SINGLE_VALUED_ONLY:
                      propDefs = typeName.allSingleValuePropertyDefinitions(propertyName);
                      break;
                  case MULTI_VALUED_ONLY:
                      propDefs = typeName.allMultiValuePropertyDefinitions(propertyName);
                      break;
                  case ANY:
                      propDefs = typeName.allPropertyDefinitions(propertyName);
                      break;
                  default:
                      throw new IllegalStateException("Should be unreachable: " + typeToCheck);
              }
  
              if (!propDefs.isEmpty()) matchingDefs.addAll(propDefs);
          }
  
          return matchingDefs;
      }
docs: Searches the supplied primary and mixin node types for all valid property definitions that match the given property name
  and cardinality.
  <p>
  If no satisfactory property definition could be found, this method returns an empty list.
  </p>
  
  @param typeNamesToCheck the name of the types to check; may not be null
  @param propertyName the name of the property for which the definitions should be retrieved
  @param typeToCheck the type of definitions to consider (single-valued only, multi-valued only, or all)
  @param pendingTypes a list of types that have been created during type registration but not yet registered in the type map
  @return a list of all valid property definitions that match the given property name and cardinality