}
}
// remove all super types if their sub types are already contained in the type set
TypeMetadataSet<EntityMetadata> uniqueTypes = new TypeMetadataSet();
for (TypeMetadata<EntityMetadata> typeMetadata : allTypeMetadatas) {
AnnotatedType annotatedType = typeMetadata.getAnnotatedType();
boolean subtype = false;
for (Iterator<TypeMetadata<EntityMetadata>> subTypeIterator = allTypeMetadatas.iterator(); subTypeIterator.hasNext() && !subtype; ) {
AnnotatedType otherAnnotatedType = subTypeIterator.next().getAnnotatedType();
if (!annotatedType.equals(otherAnnotatedType) && annotatedType.getAnnotatedElement().isAssignableFrom(otherAnnotatedType.getAnnotatedElement())) {
subtype = true;
}
}
if (!subtype) {
uniqueTypes.add(typeMetadata);