void (@NotNull JTree tree) { TreePath sibling = TreeUtil.nextVisibleSibling(tree, tree.getLeadSelectionPath()); if (sibling == null) return; // next sibling is not found tree.setSelectionPath(sibling); TreeUtil.scrollToVisible(tree, sibling, false); }