@Override
	public T[] toArray() {
		T[] a = createBucket(size());
		int i = 0;
		for (T[] bucket : buckets) {
			if ( bucket==null ) {
				continue;
			}

			for (T o : bucket) {
				if ( o==null ) {
					break;
				}

				a[i++] = o;
			}
		}

		return a;
	}
Add {@code o} to set if not there; return existing value if already
there. This method performs the same operation as {@link #add} aside from
the return value.
runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java