static String [ ] getUsable ( final List < String > available , final String [ ] supported ) { final List < String > filtered = new ArrayList < String > ( available . size ( ) ) ; final List < String > supportedList = Arrays . asList ( supported ) ; for ( final String s : available ) { if ( supportedList . contains ( s ) ) filtered . add ( s ) ; } final String [ ] filteredArray = new String [ filtered . size ( ) ] ; filtered . toArray ( filteredArray ) ; return filteredArray ; }
Returns intersection of available and supported