@Test(expected = IllegalArgumentException.class) public void getSeriesYRecalculator_NoRecalculatorForValueType() { YValueType yValueType1 = mock(YValueType.class); when(seriesYRecalculator1.handles(yValueType1)).thenReturn(false); when(seriesYRecalculator2.handles(yValueType1)).thenReturn(false); seriesYRecalculatorManager.getSeriesYRecalculator(yValueType1); }
public SeriesYRecalculator getSeriesYRecalculator(YValueType yValueType) { for (SeriesYRecalculator seriesYRecalculator : seriesYRecalculators) { if (seriesYRecalculator.handles(yValueType)) { return seriesYRecalculator; } } throw new IllegalArgumentException("no seriesYRecalculator handling " + yValueType.getClass().getName() + " can be found"); }
SeriesYRecalculatorManager { public SeriesYRecalculator getSeriesYRecalculator(YValueType yValueType) { for (SeriesYRecalculator seriesYRecalculator : seriesYRecalculators) { if (seriesYRecalculator.handles(yValueType)) { return seriesYRecalculator; } } throw new IllegalArgumentException("no seriesYRecalculator handling " + yValueType.getClass().getName() + " can be found"); } }
SeriesYRecalculatorManager { public SeriesYRecalculator getSeriesYRecalculator(YValueType yValueType) { for (SeriesYRecalculator seriesYRecalculator : seriesYRecalculators) { if (seriesYRecalculator.handles(yValueType)) { return seriesYRecalculator; } } throw new IllegalArgumentException("no seriesYRecalculator handling " + yValueType.getClass().getName() + " can be found"); }  }
SeriesYRecalculatorManager { public SeriesYRecalculator getSeriesYRecalculator(YValueType yValueType) { for (SeriesYRecalculator seriesYRecalculator : seriesYRecalculators) { if (seriesYRecalculator.handles(yValueType)) { return seriesYRecalculator; } } throw new IllegalArgumentException("no seriesYRecalculator handling " + yValueType.getClass().getName() + " can be found"); }  SeriesYRecalculator getSeriesYRecalculator(YValueType yValueType); @Autowired void setSeriesYRecalculators(List<SeriesYRecalculator> seriesYRecalculators); }
SeriesYRecalculatorManager { public SeriesYRecalculator getSeriesYRecalculator(YValueType yValueType) { for (SeriesYRecalculator seriesYRecalculator : seriesYRecalculators) { if (seriesYRecalculator.handles(yValueType)) { return seriesYRecalculator; } } throw new IllegalArgumentException("no seriesYRecalculator handling " + yValueType.getClass().getName() + " can be found"); }  SeriesYRecalculator getSeriesYRecalculator(YValueType yValueType); @Autowired void setSeriesYRecalculators(List<SeriesYRecalculator> seriesYRecalculators);  }