}
private void assertTerminatesPatterns(
DFA<Character,PowerIntState> dfa, String input, boolean... terminatesWhichPatterns)
{
PowerIntState s = dfa.getInitialState();
for(char c : input.toCharArray()) {
s = dfa.transfer(c).next(s);
}
WrappedBitSet bs = s.getTerminatedPatterns();
for(int i = 0; i < terminatesWhichPatterns.length; ++i) {
assertEquals("Pattern " + i, terminatesWhichPatterns[i], (bs == null) ? false : bs.get(i));
}
}