Answers for "Simple way to find if two different lists contain exactly the same elements?"

0

Simple way to find if two different lists contain exactly the same elements?

public static <T> boolean listEqualsIgnoreOrder(List<T> list1, List<T> list2) {
    return new HashSet<>(list1).equals(new HashSet<>(list2));
}
Posted by: Guest on July-08-2021

Code answers related to "Simple way to find if two different lists contain exactly the same elements?"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language