private static int findRowExceptSeparator(@NotNull JTree tree, int row, boolean up) {
    TreePath curPath;
    int curRow = row;
    do {
      if (up) {
        curRow--;
      }
      else {
        curRow++;
      }
      curPath = tree.getPathForRow(curRow);
    }
    while (curPath != null && DefaultTreeUI.isSeparator(curPath));

    return curRow;
  }
private static int findRowExceptSeparator(@NotNull JTree tree, int row, boolean up)