}
public void testSingleInterval(TestHarness harness)
{
harness.checkPoint("SINGLE_INTERVAL_SELECTION");
DefaultListSelectionModel m = new DefaultListSelectionModel();
m.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
// check 1 - remove the middle of a selection interval
m.addSelectionInterval(2, 6);
harness.check(m.isSelectedIndex(1), false);
harness.check(m.isSelectedIndex(2), true);
harness.check(m.isSelectedIndex(3), true);
harness.check(m.isSelectedIndex(4), true);
harness.check(m.isSelectedIndex(5), true);
harness.check(m.isSelectedIndex(6), true);
harness.check(m.isSelectedIndex(7), false);
m.addListSelectionListener(this);
m.removeIndexInterval(3, 5);
harness.check(m.isSelectedIndex(1), false);
harness.check(m.isSelectedIndex(2), true);
harness.check(m.isSelectedIndex(3), true);
harness.check(m.isSelectedIndex(4), false);
harness.check(m.isSelectedIndex(5), false);
harness.check(m.isSelectedIndex(6), false);
harness.check(m.isSelectedIndex(7), false);
harness.check(m.getLeadSelectionIndex(), 3);
harness.check(m.getAnchorSelectionIndex(), 2);
harness.check(lastEvent.getSource(), m);
harness.check(lastEvent.getFirstIndex(), 3);
harness.check(lastEvent.getLastIndex(), 6);
}