code: public static boolean sameSet(final Object[] a, final Vector b) {
      if (a == null || b == null || a.length != b.size()) {
        return false;
      }
      if (a.length == 0) {
        return true;
      }
      // Convert the array into a set
      final Hashtable t = new Hashtable();
      for (final Object element : a) {
        t.put(element, element);
      }
      for (int i = 0; i < b.size(); i++) {
        final Object o = b.elementAt(i);
        if (t.remove(o) == null) {
          return false;
        }
      }
      return t.size() == 0;
    }
docs: Compares the contents of an array and a Vector for set equality. Assumes
  input array and vector are sets (i.e. no duplicate entries)