### Question:
FixedIndicator extends AbstractIndicator<T> { @Override public T getValue(int index) { return values.get(index); } @SafeVarargs  FixedIndicator(BarSeries series, T... values); void addValue(T value); @Override T getValue(int index);  }### Answer:
@Test public void getValueOnFixedDecimalIndicator() { BarSeries series = new BaseBarSeries(); FixedDecimalIndicator fixedDecimalIndicator = new FixedDecimalIndicator(series, 13.37, 42, -17); assertNumEquals(13.37, fixedDecimalIndicator.getValue(0)); assertNumEquals(42, fixedDecimalIndicator.getValue(1)); assertNumEquals(-17, fixedDecimalIndicator.getValue(2)); fixedDecimalIndicator = new FixedDecimalIndicator(series, "3.0", "-123.456", "0.0"); assertNumEquals("3.0", fixedDecimalIndicator.getValue(0)); assertNumEquals("-123.456", fixedDecimalIndicator.getValue(1)); assertNumEquals("0.0", fixedDecimalIndicator.getValue(2)); }
@Test public void getValueOnFixedBooleanIndicator() { BarSeries series = new BaseBarSeries(); FixedBooleanIndicator fixedBooleanIndicator = new FixedBooleanIndicator(series, false, false, true, false, true); Assert.assertFalse(fixedBooleanIndicator.getValue(0)); Assert.assertFalse(fixedBooleanIndicator.getValue(1)); Assert.assertTrue(fixedBooleanIndicator.getValue(2)); Assert.assertFalse(fixedBooleanIndicator.getValue(3)); Assert.assertTrue(fixedBooleanIndicator.getValue(4)); }