private static boolean isLowerBoundCompatible ( final WildcardType type , final Class ... with ) { boolean res = true ; if ( type . getLowerBounds ( ) . length > 0 ) { // only one super could be used // couldn't be an object here as ? super Object is always replaced to simply Object before comparison final Class < ? > lower = GenericsUtils . resolveClassIgnoringVariables ( type . getLowerBounds ( ) [ 0 ] ) ; // target may only be lower bound's super type (or same type) for ( Class < ? > target : with ) { if ( ! target . isAssignableFrom ( lower ) ) { res = false ; break ; } } } return res ; }
Check that wildcard s lower bound type is not less then any of provided types .