code: private void reset() {
      calledNextStartPosition = false;
      minPosition = 0;
      maxPosition = 0;
      startPosition = -1;
      endPosition = -1;
      collectedPositions.clear();
      lastCollectedStartPosition = -1;
    }
docs: Reset.