public long[] toArray() {
    long[] result = new long[size];
    SetIterator iterator = iterator();
    int i = 0;
    while (iterator.hasNext()) {
      result[i++] = iterator.nextLong();
    }
    return result;
  }
public long[] toArray()