Java List Equal equalLists(List list1, List list2)

Here you can find the source of equalLists(List list1, List list2)

Description

equal Lists

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static boolean equalLists(List list1, List list2) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    @SuppressWarnings("unchecked")
    public static boolean equalLists(List list1, List list2) {
        if (list1.size() != list2.size()) {
            return false;
        }//from   www.  j a  v  a  2 s .  com
        List list2Clone = new ArrayList(list2);
        for (Object o : list1) {
            if (!list2Clone.contains(o)) {
                return false;
            } else {
                list2Clone.remove(o);
            }
        }
        return (list2Clone.isEmpty());
    }
}

Related

  1. equal(List objects)
  2. equal(List v1, List v2)
  3. equalLists(List a, List b)
  4. equalLists(List aV1, List aV2)
  5. equalLists(List list1, List list2)
  6. equalLists(List one, List two)
  7. equalLists(List a, List b)
  8. equals(final List fromList, final List key, final int start)
  9. equals(List A, List B)