public static < T > Collection < T > intersectWithModify ( Collection < T > first , Collection < T > second ) { E . checkNotNull ( first , "first" ) ; E . checkNotNull ( second , "second" ) ; first . retainAll ( second ) ; return first ; }
Find the intersection of two collections note that the first collection will be modified and store the results