public static < T > Collection < T > diff ( Collection < T > list1 , Collection < T > list2 ) { Collection < T > diff = new ArrayList < T > ( ) ; for ( T t : list1 ) { if ( ! list2 . contains ( t ) ) { diff . add ( t ) ; } } return diff ; }
all objects in list1 that are not in list2