question: public List < Class < ? > > findAllImplementations ( Class < ? > interfase ) throws IOException , ClassNotFoundException { List < Class < ? > > implementations = new ArrayList < > ( ) ; List < String > strings = findAllStrings ( interfase . getName ( ) ) ; for ( String className : strings ) { Class < ? > impl = _classLoader . loadClass ( className ) ; if ( ! interfase . isAssignableFrom ( impl ) ) { throw new ClassCastException ( "Class not of type: " + interfase . getName ( ) ) ; } implementations . add ( impl ) ; } return implementations ; }
target:  Assumes the class specified points to a file in the classpath that contains the name of a class that implements or is a subclass of the specfied class. <p/> Any class that cannot be loaded or assigned to the specified interface will be cause an exception to be thrown. <p/> Example classpath: <p/> META-INF/java.io.InputStream # contains the classname org.acme.AcmeInputStream META-INF/java.io.InputStream # contains the classname org.widget.NeatoInputStream META-INF/java.io.InputStream # contains the classname com.foo.BarInputStream <p/> ResourceFinder finder = new ResourceFinder("META-INF/"); List classes = finder.findAllImplementations(java.io.InputStream.class); classes.contains("org.acme.AcmeInputStream"); // true classes.contains("org.widget.NeatoInputStream"); // true classes.contains("com.foo.BarInputStream"); // true