Here you can find the source of equal(List
public static <T> boolean equal(List<T> v1, List<T> v2)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static <T> boolean equal(List<T> v1, List<T> v2) { return !v1.retainAll(v2); }// ww w .j a v a 2 s. c o m }