code: public int getTotalCardinality(Class<? extends ElementBase> sourceClass) {
          Cardinalities cardinalities = getCardinalities(sourceClass);
          return cardinalities == null ? 0 : cardinalities.total;
      }
docs: Returns the sum of cardinalities across all related classes.
  
  @param sourceClass The source class.
  @return The sum of cardinalities across all related classes.