public Collection < InstanceContextBean > apply ( Collection < InstanceContextBean > instances ) { final ArrayList < InstanceContextBean > result = new ArrayList < InstanceContextBean > ( ) ; for ( InstanceContextBean instance : instances ) { boolean installerMatches = this . installerName == null || this . installerName . equalsIgnoreCase ( instance . getInstaller ( ) ) ; if ( installerMatches && this . rootNode . isMatching ( instance ) ) result . add ( instance ) ; } result . trimToSize ( ) ; return Collections . unmodifiableCollection ( result ) ; }
Applies this filter to the given instances .