@Test
public void testStateChartWithDefaultTextConverterUsesToString() {

  StateChartModel<ToStringTestClass> model = new StateChartModel<>();
  DataSeries<ToStringTestClass> dataSeries = (range) -> ImmutableList.of(
    new SeriesData<>(0, new ToStringTestClass("Test")),
    new SeriesData<>(1000, new ToStringTestClass("Test2")));
  model.addSeries(new RangedSeries<>(new Range(0, 100), dataSeries));
  StateChart<ToStringTestClass> stateChart = new StateChart<>(model, new StateChartColorProvider<ToStringTestClass>() {
    @NotNull
    @Override
    public Color getColor(boolean isMouseOver, @NotNull ToStringTestClass value) {
      return Color.BLACK;
    }
  });
  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("Test"), anyFloat(), anyFloat());
}