if (sel.equals(oldSel) == false)
  public void addSelectionInterval(int index0, int index1)   {    if (selectionMode == SINGLE_SELECTION        || selectionMode == SINGLE_INTERVAL_SELECTION)      sel.clear();        if (selectionMode == SINGLE_SELECTION)      index0 = index1;    int lo = Math.min(index0, index1);    int hi = Math.max(index0, index1);    /* We have to update the anchorSelectionIndex and leadSelectionIndex       variables */        /* The next if statements breaks down to "if this selection is adjacent       to the previous selection and going in the same direction" */    if (((index0 - 1 == leadSelectionIndex && (index1 >= index0)               && (leadSelectionIndex >= anchorSelectionIndex))             || (index0 + 1 == leadSelectionIndex && (index1 <= index0)                  && (leadSelectionIndex <= anchorSelectionIndex)))        && (anchorSelectionIndex != -1 || leadSelectionIndex != -1))      setLeadSelectionIndex(index1);    else      {        leadSelectionIndex = index1;        anchorSelectionIndex = index0;    sel.set(lo, hi+1);    fireValueChanged(lo, hi, valueIsAdjusting);  }  }