code: static <T> ArraySet<T> fromArray(List<T> aArray, Boolean aAllowDuplicates) {
          ArraySet<T> set = new ArraySet<>();
          for (int i = 0, len = aArray.size(); i < len; i++) {
              set.add(aArray.get(i), aAllowDuplicates);
          }
          return set;
      }
docs: Static method for creating ArraySet instances from an existing array.