void (@NotNull MoveType type, @NotNull JTree tree) { TreePath lead = tree.getLeadSelectionPath(); int row = tree.getRowForPath(lead); if (lead == null || row < 0) { selectFirstExceptSeparator(type, tree); } else { row = findRowExceptSeparator(tree, row, false); // NB!: increase row before checking for cycle scrolling if (isCycleScrollingAllowed(type) && row == tree.getRowCount()) row = 0; selectExceptSeparator(type, tree, row); } }