@Test
public void componentIsNotDrawnIfInvisible() {

  Range selectionRange = new Range (60, 70);
  Range viewRange = new Range(30, 50);
  RangeSelectionComponent component = new RangeSelectionComponent(new RangeSelectionModel(selectionRange), viewRange);
  Dimension dimension = new Dimension(100, 100);
  component.setSize(dimension);
  Graphics2D graphics = mock(Graphics2D.class);
  component.draw(graphics, dimension);
  Mockito.verifyZeroInteractions(graphics);
  selectionRange.set(10, 20);
  component.draw(graphics, dimension);
  Mockito.verifyZeroInteractions(graphics);
  selectionRange.set(0, -1);
  component.draw(graphics, dimension);
  Mockito.verifyZeroInteractions(graphics);
}