public static int getRowForLocation(@NotNull JTree tree, int x, int y) {
    return Math.max(-1, tree.getRowForPath(getPathForLocation(tree, x, y)));
  }
public static int getRowForLocation(@NotNull JTree tree, int x, int y)