docs: public void resize(int newSize) {
      if (newSize > elements.length) {
        reallocate(Math.max(newSize, 2 * elements.length));
      } else {
        for (int i = size; i < newSize; i++) {
          elements[i] = 0;
        }
      }
      size = newSize;
    }