boolean nextState() {
        PsiElement next = myCurrent.getNextSibling();
        boolean isEnd = next == null || mySortable.isEnd(next);
        if (isEnd) {
          // foo("bar", "baz")
          //                 ^ here state == Element, to add last element we should handle it separately
          if (myState == State.Element) {
            myLineLayout.addElementOnLine();
            myEntryElement = myCurrent;
          }
          return false;
        }
        boolean isSeparator = mySortable.isSeparator(next) ||
                              // we assume that user forgot to add separator, so we consider error element as separator
                              ((myState == State.Element || myState == State.BetweenElementAndSeparator) && mySortable.isError(next));
        switch (myState) {
          case Element -> {
            myEntryElement = myCurrent;
            myLineLayout.addElementOnLine();
            if (isSeparator) {
              advance(next, State.Separator);
            }
            else {
              addIntermediateEntryElement(next, myBeforeSeparator);
              advance(next, State.BetweenElementAndSeparator);
            }
          }
          case BetweenElementAndSeparator -> {
            if (isSeparator) {
              advance(next, State.Separator);
            }
            else {
              addIntermediateEntryElement(next, myBeforeSeparator);
              advance(next, State.BetweenElementAndSeparator);
            }
          }
          case Separator, AfterSeparator -> {
            if (myStrategy.isSuitableEntryElement(next)) {
              finishEntry();
              advance(next, State.Element);
            }
            else {
              addIntermediateEntryElement(next, myAfterSeparator);
              advance(next, State.AfterSeparator);
            }
          }
        }
        return true;
      }
boolean nextState()