code: public DynamicType<EntityTypeMetadata<EntityMetadata>> getDynamicType(Set<Discriminator> discriminators) {
          return cache.computeIfAbsent(new HashSet<>(discriminators), key -> {
              LOGGER.debug("Cache miss for discriminators {}.", key);
              Set<EntityTypeMetadata<EntityMetadata>> metadata = new HashSet<>();
              for (Discriminator discriminator : key) {
                  Set<EntityTypeMetadata<EntityMetadata>> candidates = typeMetadataByDiscriminator.get(discriminator);
                  if (candidates != null) {
                      for (EntityTypeMetadata<EntityMetadata> candidate : candidates) {
                          Set<EntityTypeMetadata<EntityMetadata>> candidateSubTypes = aggregatedSubTypes.get(candidate);
                          if (candidateSubTypes == null || !containsAny(metadata, candidateSubTypes)) {
                              Set<Discriminator> entityDiscriminators = aggregatedDiscriminators.get(candidate);
                              if (key.size() >= entityDiscriminators.size() && key.containsAll(entityDiscriminators)) {
                                  metadata.add(candidate);
                                  // Remove all super types as they are already represented by the current type
                                  metadata.removeAll(aggregatedSuperTypes.get(candidate));
                              }
                          }
                      }
                  }
              }
              return new DynamicType<>(metadata);
          });
      }
docs: Return a {@link DynamicType} containing all types matching to the given
  entity discriminators.
  
  @param discriminators
  The discriminators.
  @return The {@link DynamicType}.