@Test(expected = IllegalArgumentException.class)
  public void getXSettingsGenerator_NoProperGeneratorFound() {

    // given

    XSettingsGenerator xsettingsGenerator = mock(XSettingsGenerator.class);
    when(xsettingsGenerator.handles(Mockito.any(ChartCode.class))).thenReturn(false);
    xsettingsGeneratorManager.setXsettingsGenerators(Lists.newArrayList(xsettingsGenerator));

    // execute

    xsettingsGeneratorManager.getXSettingsGenerator(ChartCode.MAIN_CHART);
  }
  @Test
  public void getXSettingsGenerator() {

    // given

    XSettingsGenerator xsettingsGenerator1 = mock(XSettingsGenerator.class);
    when(xsettingsGenerator1.handles(Mockito.any(ChartCode.class))).thenReturn(false);

    XSettingsGenerator xsettingsGenerator2 = mock(XSettingsGenerator.class);
    when(xsettingsGenerator2.handles(ChartCode.MAIN_CHART)).thenReturn(true);

    xsettingsGeneratorManager.setXsettingsGenerators(
        Lists.newArrayList(xsettingsGenerator1, xsettingsGenerator2));

    // execute & assert

    assertTrue(
        xsettingsGenerator2
            == xsettingsGeneratorManager.getXSettingsGenerator(ChartCode.MAIN_CHART));
  }