Here you can find the source of equals(List
public static boolean equals(List<String> l1, List<String> l2, boolean ignoreCase)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static boolean equals(List<String> l1, List<String> l2, boolean ignoreCase) { if (l1 == null || l2 == null) { return false; }//from w ww .j a v a 2 s. c o m if (l1.size() != l2.size()) { return false; } for (int i = 0; i < l1.size(); i++) { if (ignoreCase) { if (!l1.get(i).equalsIgnoreCase(l2.get(i))) { return false; } } else { if (!l1.get(i).equals(l2.get(i))) { return false; } } } return true; } }