MultiplicativeIntervalForecaster implements IntervalForecaster { @Override public IntervalForecast forecast(MetricData metricData, double pointForecast) { notNull(metricData, "metricData can't be null"); return new IntervalForecast( pointForecast * (1.0 + params.getStrongMultiplier()), pointForecast * (1.0 + params.getWeakMultiplier()), pointForecast * (1.0 - params.getWeakMultiplier()), pointForecast * (1.0 - params.getStrongMultiplier())); }  @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 * (1.0 + params.getStrongMultiplier()), forecastResult.getUpperStrong(), TOLERANCE); assertEquals(pointForecast * (1.0 + params.getWeakMultiplier()), forecastResult.getUpperWeak(), TOLERANCE); assertEquals(pointForecast * (1.0 - params.getWeakMultiplier()), forecastResult.getLowerWeak(), TOLERANCE); assertEquals(pointForecast * (1.0 - params.getStrongMultiplier()), forecastResult.getLowerStrong(), TOLERANCE); }