public static boolean checkUnorderedListsEqual ( List < ? > l1 , List < ? > l2 ) { if ( null == l1 && null != l2 ) { return false ; } if ( null != l1 && null == l2 ) { return false ; } if ( l1 . size ( ) != l2 . size ( ) ) { return false ; } for ( Object o : l1 ) { if ( ! l2 . contains ( o ) ) { return false ; } } for ( Object o : l2 ) { if ( ! l1 . contains ( o ) ) { return false ; } } return true ; }
Checks if two unordered lists are equal .