import org.junit.Test;
import com.google.common.collect.ImmutableMap;
public class MovingAverageTest {
@Test
public void simpleTest() {
<BUG>MacroBaseConf conf = new MacroBaseConf(ImmutableMap.of(MacroBaseConf.TUPLE_WINDOW, 3));
</BUG>
MovingAverage ma = new MovingAverage(conf);
assertEquals(0, ma.score(createDatum(0, 1)), 0);
assertEquals(1/3.0, ma.score(createDatum(1, 2)), 1e-5); // Average = 1.5

import org.junit.Test;
import com.google.common.collect.ImmutableMap;
public class MovingAverageTest {
@Test
public void simpleTest() {
MacroBaseConf conf = new MacroBaseConf().set(MacroBaseConf.TUPLE_WINDOW, 3);
MovingAverage ma = new MovingAverage(conf);
assertEquals(0, ma.score(createDatum(0, 1)), 0);
assertEquals(1/3.0, ma.score(createDatum(1, 2)), 1e-5); // Average = 1.5
