public static < T > List < T > subList ( List < T > list , Criteria < T > criteria ) { ArrayList < T > subList = new ArrayList < T > ( ) ; for ( T item : list ) { if ( criteria . meetsCriteria ( item ) ) { subList . add ( item ) ; } } return subList ; }
Extract a sub list from another list