private void doTest(String text, boolean first, String... expected) {
BnfFile f = (BnfFile)myFixture.configureByText("a.bnf", text);
List<BnfRule> rules = f.getRules();
assertFalse(rules.isEmpty());
BnfFirstNextAnalyzer analyzer = new BnfFirstNextAnalyzer();
Set<String> strings = analyzer.asStrings(first? analyzer.calcFirst(rules.get(0)) : analyzer.calcNext(rules.get(0)).keySet());
String[] result = ArrayUtil.toStringArray(strings);
Arrays.sort(result);
assertOrderedEquals(result, expected);
}
}