code: public void set(int doc) {
          if (initialized) {
              throw new IllegalStateException(
                      "You must not call set() after next() or skipTo()");
          }
          if (index >= hits.length) {
              int[] resizedHits = new int[hits.length * 2];
              System.arraycopy(hits, 0, resizedHits, 0, hits.length);
              hits = resizedHits;
          }
          hits[index++] = doc;
      }
docs: {@inheritDoc}