docs: public MtasSpanQuery getQuery() throws ParseException {
      simplify();
      MtasSpanSequenceItem currentQuery = null;
      List<MtasSpanSequenceItem> currentQueryList = null;
      for (MtasCQLParserBasicSentencePartCondition part : partList) {
        // start list
        if (currentQuery != null) {
          currentQueryList = new ArrayList<MtasSpanSequenceItem>();
          currentQueryList.add(currentQuery);
          currentQuery = null;
        }
        if (part.getMaximumOccurence() > 1) {
          MtasSpanQuery q = new MtasSpanRecurrenceQuery(part.getQuery(),
              part.getMinimumOccurence(), part.getMaximumOccurence(),
              ignoreClause, maximumIgnoreLength);
          currentQuery = new MtasSpanSequenceItem(q, part.isOptional());
        } else {
          currentQuery = new MtasSpanSequenceItem(part.getQuery(),
              part.isOptional());
        }
        // add to list, if it exists
        if (currentQueryList != null) {
          currentQueryList.add(currentQuery);
          currentQuery = null;
        }
      }
      if (currentQueryList != null) {
        return new MtasSpanSequenceQuery(currentQueryList, ignoreClause,
            maximumIgnoreLength);
      } else if (currentQuery.isOptional()) {
        currentQueryList = new ArrayList<MtasSpanSequenceItem>();
        currentQueryList.add(currentQuery);
        currentQuery = null;
        return new MtasSpanSequenceQuery(currentQueryList, ignoreClause,
            maximumIgnoreLength);
      } else {
        return currentQuery.getQuery();
      }
    }