AdditiveIntervalForecaster implements IntervalForecaster { @Override public IntervalForecast forecast(MetricData metricData, double pointForecast) { notNull(metricData, "metricData can't be null"); return new IntervalForecast( pointForecast + params.getStrongValue(), pointForecast + params.getWeakValue(), pointForecast - params.getWeakValue(), pointForecast - params.getStrongValue()); }  @Override IntervalForecast forecast(MetricData metricData, double pointForecast);  }
@Test public void testForecast() { val params = forecasterUnderTest.getParams(); val pointForecast = 132.4; val forecastResult = forecasterUnderTest.forecast(metricDataDummy, pointForecast); assertEquals(pointForecast + params.getStrongValue(), forecastResult.getUpperStrong(), TOLERANCE); assertEquals(pointForecast + params.getWeakValue(), forecastResult.getUpperWeak(), TOLERANCE); assertEquals(pointForecast - params.getWeakValue(), forecastResult.getLowerWeak(), TOLERANCE); assertEquals(pointForecast - params.getStrongValue(), forecastResult.getLowerStrong(), TOLERANCE); }