sum = hi - lo;
sum = hi - lo + 1;
  private static int countSelections(ListSelectionModel lsm)  {    int lo = lsm.getMinSelectionIndex();    int hi = lsm.getMaxSelectionIndex();    int sum = 0;    if (lo != -1 && hi != -1)      {        switch (lsm.getSelectionMode())          {          case ListSelectionModel.SINGLE_SELECTION:            sum = 1;            break;                      case ListSelectionModel.SINGLE_INTERVAL_SELECTION:            sum = hi - lo;            break;                      case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:                    for (int i = lo; i < hi; ++i)              if (lsm.isSelectedIndex(i))                        ++sum;            break;          }      }    return sum;  }