### Question:
PercentRankIndicator extends SingleValueIndicator { @Override public double getValue() { return value; } PercentRankIndicator(TimeInterval interval);  PercentRankIndicator(int length, TimeInterval interval); @Override double getValue();  }### Answer:
@Test public void isUsable() { PercentRankIndicator b = new PercentRankIndicator(10, minutes(1)); b.accumulate(newCandle(1, 1.0)); b.accumulate(newCandle(2, 2.0)); assertEquals(50.0, b.getValue(), 0.001); b.accumulate(newCandle(3, 3.0)); assertEquals(33.3333, b.getValue(), 0.001); b.accumulate(newCandle(4, 2.0)); assertEquals(0.0, b.getValue(), 0.001); b.accumulate(newCandle(4, 3.0)); assertEquals(40.0, b.getValue(), 0.001); b.accumulate(newCandle(5, 10.0)); assertEquals(83.3333, b.getValue(), 0.001); b = new PercentRankIndicator(minutes(2)); b.recalculateEveryTick(true); b.accumulate(newCandle(1, 1.0)); b.accumulate(newCandle(2, 2.0)); assertEquals(0.0, b.getValue(), 0.001); b.accumulate(newCandle(3, 3.0)); assertEquals(50.0, b.getValue(), 0.001); b.accumulate(newCandle(4, 2.5)); assertEquals(50, b.getValue(), 0.001); b.accumulate(newCandle(5, 2.5)); assertEquals(0.0, b.getValue(), 0.001); }