private < T > void check ( T t , BiConsumer < T , AddOnModel > specific ) { if ( ! shouldCheck ( ) ) { return ; } secureAccess . doElevated ( this :: getAddOnModelForClassLoader ) . ifPresent ( addOnModel -> secureAccess . doElevated ( ( ) -> specific . accept ( t , addOnModel ) ) ) ; }
this method first performs some basic checks and then performs the specific check