@Test
public void testStateChartTextConverter() {

  StateChartModel<Integer> model = new StateChartModel<>();
  DataSeries<Integer> dataSeries = (range) -> ImmutableList.of(new SeriesData<>(0,1),
                                                               new SeriesData<>(1000, 2));
  model.addSeries(new RangedSeries<>(new Range(0, 100), dataSeries));
  StateChart<Integer> stateChart = new StateChart<>(model, new StateChartColorProvider<Integer>() {
    @NotNull
    @Override
    public Color getColor(boolean isMouseOver, Integer value) {
      return Color.BLACK;
    }
  }, (value) -> "123");
  stateChart.setSize(100, 100);
  stateChart.setRenderMode(StateChart.RenderMode.TEXT);
  Graphics2D fakeGraphics = mock(Graphics2D.class);
  when(fakeGraphics.create()).thenReturn(fakeGraphics);
  stateChart.paint(fakeGraphics);
  verify(fakeGraphics, times(1)).drawString(eq("123"), anyFloat(), anyFloat());
}