### Question:
CommodityChannelIndex extends SingleValueIndicator { @Override public double getValue() { return value; } CommodityChannelIndex(int length, TimeInterval interval); @Override double getValue();  }### Answer:
@Test public void cci() { int i = 0; CommodityChannelIndex indicator = new CommodityChannelIndex(20, TimeInterval.MINUTE); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(0, indicator.getValue(), 0.0001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(-66.6667, indicator.getValue(), 0.0001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(-100d, indicator.getValue(), 0.0001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(14.365, indicator.getValue(), 0.0001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(54.2544, indicator.getValue(), 0.0001); }