private < T > Set < ? extends T > create ( Iterable < Class < ? extends T > > types ) { Set < T > result = new HashSet <> ( ) ; for ( Class < ? extends T > t : types ) { if ( ! Modifier . isAbstract ( t . getModifiers ( ) ) && ! t . isInterface ( ) ) { T instance = factory . create ( t ) ; result . add ( instance ) ; } } return Collections . unmodifiableSet ( result ) ; }
Create the given types .