public static boolean cmpList(List<?> l1,List<?> l2){
  if ((l1 == null) && (l2 == null)) {
    return true;
  }
  if ((l1 == null) || (l2 == null)) {
    return false;
  }
  ArrayList<?> cp=new ArrayList<>(l1);
  for (  Object o : l2) {
    if (!cp.remove(o)) {
      return false;
    }
  }
  return cp.isEmpty();
}

public static boolean cmpList ( List < ? > l1 , List < ? > l2 ) { if ( ( l1 == null ) && ( l2 == null ) ) { return true ; } if ( ( l1 == null ) || ( l2 == null ) ) { return false ; } ArrayList < ? > cp = new ArrayList < > ( l1 ) ; for ( Object o : l2 ) { if ( ! cp . remove ( o ) ) { return false ; } } return cp . isEmpty ( ) ; }
compares lists of objects
