docs: private static IndexedTypeSet toRootEntities(ExtendedSearchIntegrator extendedIntegrator, Class<?>... selection) {
  		Set<Class<?>> entities = new HashSet<Class<?>>();
  		//first build the "entities" set containing all indexed subtypes of "selection".
  		for ( Class<?> entityType : selection ) {
  			IndexedTypeSet targetedClasses = extendedIntegrator.getIndexedTypesPolymorphic( IndexedTypeSets.fromClass( entityType ) );
  			if ( targetedClasses.isEmpty() ) {
  				String msg = entityType.getName() + " is not an indexed entity or a subclass of an indexed entity";
  				throw new IllegalArgumentException( msg );
  			}
  			entities.addAll( targetedClasses.toPojosSet() );
  		}
  		Set<Class<?>> cleaned = new HashSet<Class<?>>();
  		Set<Class<?>> toRemove = new HashSet<Class<?>>();
  		//now remove all repeated types to avoid duplicate loading by polymorphic query loading
  		for ( Class<?> type : entities ) {
  			boolean typeIsOk = true;
  			for ( Class<?> existing : cleaned ) {
  				if ( existing.isAssignableFrom( type ) ) {
  					typeIsOk = false;
  					break;
  				}
  				if ( type.isAssignableFrom( existing ) ) {
  					toRemove.add( existing );
  				}
  			}
  			if ( typeIsOk ) {
  				cleaned.add( type );
  			}
  		}
  		cleaned.removeAll( toRemove );
  		log.debugf( "Targets for indexing job: %s", cleaned );
  		return IndexedTypeSets.fromClasses( cleaned.toArray( new Class[cleaned.size()] ) );
  	}