public static @Nullable TreeElement nextLeaf(@NotNull TreeElement start,
                                               CommonParentState commonParent,
                                               IElementType searchedType,
                                               boolean expandChameleons) {
    TreeElement element = start;
    while (element != null) {
      if (commonParent != null) {
        commonParent.startLeafBranchStart = element;
        initStrongWhitespaceHolder(commonParent, element, true);
      }
      TreeElement nextTree = element;
      TreeElement next = null;
      while (next == null && (nextTree = nextTree.getTreeNext()) != null) {
        if (nextTree.getElementType() == searchedType) {
          return nextTree;
        }
        next = findFirstLeafOrType(nextTree, searchedType, commonParent, expandChameleons);
      }
      if (next != null) {
        if (commonParent != null) commonParent.nextLeafBranchStart = nextTree;
        return next;
      }
      element = element.getTreeParent();
    }
    return null;
  }
public static @Nullable TreeElement nextLeaf(@NotNull TreeElement start,
                                               CommonParentState commonParent,
                                               IElementType searchedType,
                                               boolean expandChameleons)