@Test public void isSatisfied() { FixedRule fixedRule = new FixedRule(); assertFalse(fixedRule.isSatisfied(0)); assertFalse(fixedRule.isSatisfied(1)); assertFalse(fixedRule.isSatisfied(2)); assertFalse(fixedRule.isSatisfied(9)); fixedRule = new FixedRule(1, 2, 3); assertFalse(fixedRule.isSatisfied(0)); assertTrue(fixedRule.isSatisfied(1)); assertTrue(fixedRule.isSatisfied(2)); assertTrue(fixedRule.isSatisfied(3)); assertFalse(fixedRule.isSatisfied(4)); assertFalse(fixedRule.isSatisfied(5)); assertFalse(fixedRule.isSatisfied(6)); assertFalse(fixedRule.isSatisfied(7)); assertFalse(fixedRule.isSatisfied(8)); assertFalse(fixedRule.isSatisfied(9)); assertFalse(fixedRule.isSatisfied(10)); }
@Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { boolean satisfied = false; for (int idx : indexes) { if (idx == index) { satisfied = true; break; } } traceIsSatisfied(index, satisfied); return satisfied; }
FixedRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { boolean satisfied = false; for (int idx : indexes) { if (idx == index) { satisfied = true; break; } } traceIsSatisfied(index, satisfied); return satisfied; } }
FixedRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { boolean satisfied = false; for (int idx : indexes) { if (idx == index) { satisfied = true; break; } } traceIsSatisfied(index, satisfied); return satisfied; } FixedRule(int... indexes); }
FixedRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { boolean satisfied = false; for (int idx : indexes) { if (idx == index) { satisfied = true; break; } } traceIsSatisfied(index, satisfied); return satisfied; } FixedRule(int... indexes); @Override boolean isSatisfied(int index, TradingRecord tradingRecord); }
FixedRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { boolean satisfied = false; for (int idx : indexes) { if (idx == index) { satisfied = true; break; } } traceIsSatisfied(index, satisfied); return satisfied; } FixedRule(int... indexes); @Override boolean isSatisfied(int index, TradingRecord tradingRecord);  }