@Test
public void testParserInheritance() {

    class Parent {
        @Field(required = true) int overridden;
        @Field(required = true) int parentField;
    }
    class Child extends Parent {
        @Field(required = true) int overridden;
        @Field(required = true) int childField;
    }
    int val = 1;
    Map<String, Param> params = new HashMap<>();
    params.put("overridden", new Param<>("oevrriden", val));
    params.put("parentField", new Param<>("parentField", val));
    params.put("childField", new Param<>("childField", val));
    try {
        Child child = new Child();
        AnnotationUtils.assignFieldParams(child, params);
        Assert.assertEquals(child.overridden, val);
        Assert.assertEquals(child.parentField, val);
        Assert.assertEquals(child.childField, val);
    } catch (TikaConfigException e) {
        e.printStackTrace();
        Assert.fail("Exception Not expected");
    }
    try {
        params.remove("parentField");
        AnnotationUtils.assignFieldParams(new Child(), params);
        Assert.fail("Exception expected, parent class field not set");
    } catch (TikaConfigException e) {
        //expected
    }
}