docs: private void simplifySequence(List<MtasCQLParserSentenceCondition> sequence)
        throws ParseException {
      List<MtasCQLParserSentenceCondition> newSequence = new ArrayList<MtasCQLParserSentenceCondition>();
      MtasCQLParserSentenceCondition lastSentence = null;
      for (MtasCQLParserSentenceCondition sentence : sequence) {
        sentence.simplify();
        if (lastSentence == null) {
          lastSentence = sentence;
        } else if (lastSentence.isBasic() && sentence.isBasic()) {
          if (!lastSentence.isOptional() && !sentence.isOptional()
              && sentence.getMaximumOccurence() == 1
              && lastSentence.getMaximumOccurence() == 1) {
            lastSentence.basicSentence.addBasicSentence(sentence.basicSentence);
          } else {
            newSequence.add(lastSentence);
            lastSentence = sentence;
          }
        } else if (lastSentence.isBasic() && !sentence.isBasic()) {
          if (sentence.isSingle() && !sentence.isOptional()
              && sentence.getMaximumOccurence() == 1
              && lastSentence.getMaximumOccurence() == 1) {
            // add all items from (first) sequenceList potentially to the new
            // sequence
            for (MtasCQLParserSentenceCondition subSentence : sentence.sequenceList
                .get(0)) {
              newSequence.add(lastSentence);
              lastSentence = subSentence;
            }
          } else {
            // add sentence potentially to the new sequence
            newSequence.add(lastSentence);
            lastSentence = sentence;
          }
        } else if (!lastSentence.isBasic() && sentence.isBasic()) {
          if (lastSentence.isSingle() && !lastSentence.isOptional()
              && sentence.getMaximumOccurence() == 1
              && lastSentence.getMaximumOccurence() == 1) {
            // add basic sentence to end latest sequence
            lastSentence
                .addBasicSentenceToEndLatestSequence(sentence.basicSentence);
          } else {
            // add sentence potentially to the new sequence
            newSequence.add(lastSentence);
            lastSentence = sentence;
          }
        } else {
          if (sentence.isSingle() && !sentence.isOptional()
              && lastSentence.isSingle() && !lastSentence.isOptional()
              && sentence.getMaximumOccurence() == 1
              && lastSentence.getMaximumOccurence() == 1) {
            // combine sentences
            for (MtasCQLParserSentenceCondition subSentence : sentence.sequenceList
                .get(0)) {
              lastSentence.sequenceList.get(0).add(subSentence);
            }
          } else {
            // add sentence potentially to the new sequence (both not basic)
            newSequence.add(lastSentence);
            lastSentence = sentence;
          }
        }
      }
      // add last to newSequence
      if (lastSentence != null) {
        newSequence.add(lastSentence);
      }
      // replace content sequence with newSequence
      sequence.clear();
      sequence.addAll(newSequence);
    }