public static @Nullable TreePath nextVisibleSibling(@NotNull JTree tree, @Nullable TreePath lead) {
    TreePath parent = lead == null ? null : lead.getParentPath();
    return parent == null ? null : nextVisiblePath(tree, lead, path -> parent.equals(path.getParentPath()));
  }
public static @Nullable TreePath nextVisibleSibling(@NotNull JTree tree, @Nullable TreePath lead)