EStructuralFeature feature = createMock(EStructuralFeature.class);
Antlr4Validator validator = PowerMock.createPartialMock(Antlr4Validator.class, "error");
expect(token.getName()).andReturn("t");
expect(token.eClass()).andReturn(eClass);
expect(eClass.getEStructuralFeature("name")).andReturn(feature);
PowerMock.expectPrivate(validator, "error",
"token names must start with an uppercase letter: t",
token, feature);