code: public void addCardinality(Class<? extends ElementBase> sourceClass, Class<? extends ElementBase> targetClass,
                                 int maxOccurrences) {
          Cardinality cardinality = new Cardinality(sourceClass, targetClass, maxOccurrences);
          getOrCreateCardinalities(sourceClass).addCardinality(cardinality);
      }
docs: Adds cardinality relationship between source and target classes.
  
  @param sourceClass The source class.
  @param targetClass Class to be registered.
  @param maxOccurrences Maximum occurrences for this relationship.