Grammar { public Rule rule(GrammarRuleKey ruleKey) { throw new UnsupportedOperationException(); } Grammar(); static List<Field> getRuleFields(Class grammarClass); static List<Field> getAllRuleFields(Class grammarClass); Rule rule(GrammarRuleKey ruleKey); abstract Rule getRootRule();  }
@Test public void method_rule_should_throw_exception_by_default() { thrown.expect(UnsupportedOperationException.class); new MyGrammar().rule(mock(GrammarRuleKey.class)); }