code: private Set<Discriminator> getAggregatedDiscriminators(EntityTypeMetadata<EntityMetadata> typeMetadata) {
          Set<Discriminator> discriminators = aggregatedDiscriminators.get(typeMetadata);
          if (discriminators == null) {
              discriminators = new HashSet<>();
              Discriminator discriminator = typeMetadata.getDatastoreMetadata().getDiscriminator();
              if (discriminator != null) {
                  discriminators.add(discriminator);
              }
              for (EntityTypeMetadata<EntityMetadata> superTypeMetadata : aggregatedSuperTypes.get(typeMetadata)) {
                  discriminator = superTypeMetadata.getDatastoreMetadata().getDiscriminator();
                  if (discriminator != null) {
                      discriminators.add(discriminator);
                  }
              }
              aggregatedDiscriminators.put(typeMetadata, discriminators);
          }
          return discriminators;
      }
docs: Determine the set of discriminators for one type, i.e. the discriminator of
  the type itself and of all it's super types.
  
  @param typeMetadata
  The type.
  @return The set of discriminators.