SmaPointForecasterParams implements AlgoParams { @Override public void validate() { isStrictlyPositive(lookBackPeriod, "Required: lookBackPeriod > 0"); isTrue(initialPeriodOfValuesValid(), "When specified, initialPeriodOfValues.size must equal lookBackPeriod"); }  @Override void validate();  }
@Test public void validParamsTotallyEmpty() { new SmaPointForecasterParams() .validate(); }
@Test public void validParamsLookbackOnly() { new SmaPointForecasterParams() .setLookBackPeriod(3) .validate(); }
@Test public void validParamsFullyPopulated() { new SmaPointForecasterParams() .setLookBackPeriod(3) .setInitialPeriodOfValues(Arrays.asList(1.0, 2.0, 3.0)) .validate(); }
@Test(expected = IllegalArgumentException.class) public void invalidLookbackPeriod() { new SmaPointForecasterParams() .setLookBackPeriod(-1) .validate(); }
@Test(expected = IllegalArgumentException.class) public void invalidInitialPeriodOfValues() { new SmaPointForecasterParams() .setLookBackPeriod(2) .setInitialPeriodOfValues(Arrays.asList(1.0, 2.0, 3.0)) .validate(); }