Java List Equal equalLists(List one, List two)

Here you can find the source of equalLists(List one, List two)

Description

equal Lists

License

Apache License

Declaration

public static boolean equalLists(List<String> one, List<String> two) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import java.util.Collections;

import java.util.List;

public class Main {
    public static boolean equalLists(List<String> one, List<String> two) {
        if (one == null && two == null) {
            return true;
        }//from w  w w  .  ja va  2  s.c  om
        if ((one == null && two != null) || one != null && two == null || one.size() != two.size()) {
            return false;
        }
        ArrayList<String> oneCopy = new ArrayList<>(one);
        ArrayList<String> twoCopy = new ArrayList<>(two);
        Collections.sort(oneCopy);
        Collections.sort(twoCopy);
        return one.equals(twoCopy);
    }
}

Related

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