public static <T>boolean equals(List<T> a,List<T> b){
  if (a == b) {
    return true;
  }
 else   if (a == null || b == null) {
    return false;
  }
 else   if (a.size() != b.size()) {
    return false;
  }
 else {
    for (int i=0; i < a.size(); i++) {
      T itemA=a.get(i);
      T itemB=b.get(i);
      if (!equal(itemA,itemB)) {
        return false;
      }
    }
    return true;
  }
}

public static < T > boolean equals ( List < T > a , List < T > b ) { if ( a == b ) { return true ; } else if ( a == null || b == null ) { return false ; } else if ( a . size ( ) != b . size ( ) ) { return false ; } else { for ( int i = 0 ; i < a . size ( ) ; i ++ ) { T itemA = a . get ( i ) ; T itemB = b . get ( i ) ; if ( ! equal ( itemA , itemB ) ) { return false ; } } return true ; } }
check if two lists are equal . the lists are equal if they are both the same size , and the items at every index are equal according to the provided equator . returns true if both lists are null .
