expect(grammar.getModes()).andReturn(new BasicEList<Mode>());
expect(rule1.getName()).andReturn("rule");
expect(rule2.getName()).andReturn("rule");
expect(rule2.eClass()).andReturn(eClass);
expect(eClass.getEStructuralFeature("name")).andReturn(feature);
PowerMock.expectPrivate(validator, "error", "rule 'rule' redefinition", rule2, feature);