@Test
public void testBuildDetector() {

    val factoryUnderTest = new LegacyEwmaDetectorFactoryProvider();
    val document = readDocument("ewma");
    val detector = factoryUnderTest.buildDetector(document);
    val ewma = (EwmaPointForecaster) detector.getPointForecaster();
    val ewmaParams = ewma.getParams();
    val welford = (ExponentialWelfordIntervalForecaster) detector.getIntervalForecaster();
    val welfordParams = welford.getParams();
    assertEquals(ForecastingDetector.class, detector.getClass());
    assertEquals("3e047348-f837-f615-271c-dce6206f50d6", detector.getUuid().toString());
    assertEquals(AnomalyType.RIGHT_TAILED, detector.getAnomalyType());
    assertEquals(0.20, ewmaParams.getAlpha(), TOLERANCE);
    assertEquals(1.4, ewmaParams.getInitMeanEstimate(), TOLERANCE);
    assertEquals(3.0, welfordParams.getWeakSigmas(), TOLERANCE);
    assertEquals(4.0, welfordParams.getStrongSigmas(), TOLERANCE);
}