### Question:
InPipeRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { final boolean satisfied = ref.getValue(index).isLessThanOrEqual(upper.getValue(index)) && ref.getValue(index).isGreaterThanOrEqual(lower.getValue(index)); traceIsSatisfied(index, satisfied); return satisfied; } InPipeRule(Indicator<Num> ref, Number upper, Number lower);  InPipeRule(Indicator<Num> ref, Num upper, Num lower);  InPipeRule(Indicator<Num> ref, Indicator<Num> upper, Indicator<Num> lower); @Override boolean isSatisfied(int index, TradingRecord tradingRecord);  }### Answer:
@Test public void isSatisfied() { assertTrue(rule.isSatisfied(0)); assertTrue(rule.isSatisfied(1)); assertTrue(rule.isSatisfied(2)); assertFalse(rule.isSatisfied(3)); assertFalse(rule.isSatisfied(4)); assertTrue(rule.isSatisfied(5)); assertTrue(rule.isSatisfied(6)); assertTrue(rule.isSatisfied(7)); assertFalse(rule.isSatisfied(8)); assertFalse(rule.isSatisfied(9)); }