### Question:
ChangeIndicator extends SingleValueIndicator { @Override public double getValue() { return value; } ChangeIndicator(TimeInterval interval);  ChangeIndicator(TimeInterval interval, ToDoubleFunction<Candle> valueGetter); @Override double getValue();  }### Answer:
@Test public void isUsable() { ChangeIndicator b = new ChangeIndicator(minutes(1)); b.accumulate(newCandle(1, 1.0)); b.accumulate(newCandle(2, 2.0)); assertEquals(100.0, b.getValue(), 0.001); b.accumulate(newCandle(3, 3.0)); assertEquals(50.0, b.getValue(), 0.001); b.accumulate(newCandle(4, 2.0)); assertEquals(-33.333333, b.getValue(), 0.001); b.accumulate(newCandle(4, 3.0)); assertEquals(50.0, b.getValue(), 0.001); b = new ChangeIndicator(minutes(2)); b.recalculateEveryTick(true); b.accumulate(newCandle(1, 2.0)); b.accumulate(newCandle(2, 1.0)); assertEquals(0.0, b.getValue(), 0.001); b.accumulate(newCandle(3, 3.0)); assertEquals(200.0, b.getValue(), 0.001); b.accumulate(newCandle(4, 2.5)); assertEquals(150.0, b.getValue(), 0.001); b.accumulate(newCandle(5, 2.0)); assertEquals(-20.0, b.getValue(), 0.001); b.accumulate(newCandle(6, 3.0)); assertEquals(20.0, b.getValue(), 0.001); }