Mode mode = createMock(Mode.class);
EClass eClass = createMock(EClass.class);
EStructuralFeature feature = createMock(EStructuralFeature.class);
Antlr4Validator validator = PowerMock.createPartialMock(Antlr4Validator.class, "error");
expect(mode.eContainer()).andReturn(grammar);
expect(grammar.getType()).andReturn(GrammarType.DEFAULT);
expect(mode.eClass()).andReturn(eClass);
expect(eClass.getEStructuralFeature("id")).andReturn(feature);