EStructuralFeature feature = createMock(EStructuralFeature.class);
Antlr4Validator validator = PowerMock.createPartialMock(Antlr4Validator.class, "error");
expect(ruleRef.getReference()).andReturn(reference);
expect(ruleRef.getArgs()).andReturn(null);
expect(ruleRef.eClass()).andReturn(eClass);
expect(reference.getName()).andReturn("rule");
expect(reference.getArgs()).andReturn("[int a, int b]");
expect(eClass.getEStructuralFeature("reference")).andReturn(feature);