for (int i = lo; i < hi; ++i)
for (int i = lo; i <= hi; ++i)
  private static int[] getSelections(ListSelectionModel lsm)  {    int sz = countSelections(lsm);    int [] ret = new int[sz];    int lo = lsm.getMinSelectionIndex();    int hi = lsm.getMaxSelectionIndex();    int j = 0;    java.util.ArrayList ls = new java.util.ArrayList();    if (lo != -1 && hi != -1)      {        switch (lsm.getSelectionMode())          {          case ListSelectionModel.SINGLE_SELECTION:            ret[0] = lo;            break;                      case ListSelectionModel.SINGLE_INTERVAL_SELECTION:                        for (int i = lo; i < hi; ++i)              ret[j++] = i;            break;                      case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:                    for (int i = lo; i < hi; ++i)              if (lsm.isSelectedIndex(i))                        ret[j++] = i;            break;          }      }    return ret;  }