Here you can find the source of areEqualConsideringOrder(List listA, List listB)
@SuppressWarnings("unchecked") public static boolean areEqualConsideringOrder(List listA, List listB)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { @SuppressWarnings("unchecked") public static boolean areEqualConsideringOrder(List listA, List listB) { return !areDifferentConsideringOrder(listA, listB); }// w ww . j a v a2 s .c o m @SuppressWarnings("unchecked") public static boolean areDifferentConsideringOrder(List listA, List listB) { if (listA.size() != listB.size()) { return true; } for (int i = 0; i < listA.size(); i++) { Object valueA = listA.get(i); Object valueB = listB.get(i); if (!valueA.equals(valueB)) { return true; } } return false; } }