@Test
public void canDragSelectionToPan() {

  RangeSelectionModel model = new RangeSelectionModel(new Range(40, 50));
  RangeSelectionComponent component = new RangeSelectionComponent(model, new Range(0, 100));
  component.setDragBarHeight(10);
  component.setSize(100, 100);
  FakeUi ui = new FakeUi(component);
  ui.mouse.press(45, 9);
  assertThat(model.getSelectionRange().getMin()).isWithin(DELTA).of(40);
  assertThat(model.getSelectionRange().getMax()).isWithin(DELTA).of(50);
  assertThat(component.getCursor()).isEqualTo(AdtUiCursors.GRABBING);
  ui.mouse.dragDelta(40, 0);
  assertThat(model.getSelectionRange().getMin()).isWithin(DELTA).of(80);
  assertThat(model.getSelectionRange().getMax()).isWithin(DELTA).of(90);
  ui.mouse.release();
  assertThat(component.getCursor()).isEqualTo(AdtUiCursors.GRAB);
}