@SuppressWarnings("unchecked")
    public static <T extends Class<?>> Map<T, Specification<? extends T>> classpathRequestForDescendantTypesOf(
            ClasspathScanRequestBuilder classpathScanRequestBuilder, Collection<T> interfaces) {
        Map<T, Specification<? extends T>> specsByInterface = new HashMap<>();
        for (T anInterface : interfaces) {
            LOGGER.trace("Request implementations of: {}", anInterface.getName());
            Specification<Class<?>> spec = new SpecificationBuilder<>(
                    classIsDescendantOf(anInterface).and(classIsInterface().negate())
                            .and(classModifierIs(Modifier.ABSTRACT).negate())).build();
            classpathScanRequestBuilder.specification(spec);
            specsByInterface.put(anInterface, (Specification<? extends T>) spec);
        }
        return specsByInterface;
    }
@ SuppressWarnings ( "unchecked" ) public static < T extends Class < ? > > Map < T , Specification < ? extends T > > classpathRequestForDescendantTypesOf ( ClasspathScanRequestBuilder classpathScanRequestBuilder , Collection < T > interfaces ) { Map < T , Specification < ? extends T > > specsByInterface = new HashMap < > ( ) ; for ( T anInterface : interfaces ) { LOGGER . trace ( "Request implementations of: {}" , anInterface . getName ( ) ) ; Specification < Class < ? > > spec = new SpecificationBuilder < > ( classIsDescendantOf ( anInterface ) . and ( classIsInterface ( ) . negate ( ) ) . and ( classModifierIs ( Modifier . ABSTRACT ) . negate ( ) ) ) . build ( ) ; classpathScanRequestBuilder . specification ( spec ) ; specsByInterface . put ( anInterface , ( Specification < ? extends T > ) spec ) ; } return specsByInterface ; }
Builds a ClasspathScanRequest to find all the descendant of the given interfaces.

@param <T>                         the class of the interface.
@param classpathScanRequestBuilder the Nuun classpath scan request builder.
@param interfaces                  the interfaces.
@return a map where the key is an interface and the value is a specification matching
descendants of this interface.