public static <T> boolean equalsSetHelper(Set<T> set, Object object) {
        if (set == object) {
            return true;
        }
        if (object instanceof Set) {
            Set<?> s = (Set<?>) object;

            try {
                return set.size() == s.size() && set.containsAll(s);
            } catch (NullPointerException ignored) {
                return false;
            } catch (ClassCastException ignored) {
                return false;
            }
        }
        return false;
    }
Helper for writing standard Java collection interfaces to a data
structure like {@link ArrayMap}.

@author RePlugin Team
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/utils/basic/MapCollections.java