code: public void removeBefore(int docId, int position) {
      if (ignoreSpans != null && docId == currentDocId) {
        baseStartPositionList.entrySet()
            .removeIf(entry -> entry.getKey() < position);
        baseEndPositionList.entrySet()
            .removeIf(entry -> entry.getKey() < position);
        fullEndPositionList.entrySet()
            .removeIf(entry -> entry.getKey() < position);
        minBaseStartPosition.entrySet()
            .removeIf(entry -> entry.getKey() < position);
        maxBaseEndPosition.entrySet()
            .removeIf(entry -> entry.getKey() < position);
        minFullStartPosition.entrySet()
            .removeIf(entry -> entry.getKey() < position);
        maxFullEndPosition.entrySet()
            .removeIf(entry -> entry.getKey() < position);
        if (minimumPosition < position) {
          minimumPosition = position;
        }
        if (currentPosition < position) {
          currentPosition = position;
        }
      }
    }
docs: Removes the before.
  
  @param docId the doc id
  @param position the position