Here you can find the source of equals(String[] fullSet, String[] subSet)
public static boolean equals(String[] fullSet, String[] subSet)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.List; public class Main { public static boolean equals(String[] fullSet, String[] subSet) { if (isEmpty(fullSet) && isEmpty(subSet)) { return true; }//from w w w. j a va2 s .c o m if (length(fullSet) != length(subSet)) { return false; } List<String> fullList = Arrays.asList(fullSet); List<String> subList = Arrays.asList(subSet); return fullList.containsAll(subList) && subList.containsAll(fullList); } public static boolean isEmpty(String[] arg) { if (arg == null) { return true; } return arg.length == 0; } public static int length(String[] strs) { if (isEmpty(strs)) { return 0; } return strs.length; } }