@Test
public void testParamValueInheritance() {

    class Bean {
        @Field(required = true) CharSequence field;
    }
    Bean parser = new Bean();
    Map<String, Param> params = new HashMap<>();
    try {
        String val = "someval";
        params.put("field", new Param<String>("field", String.class, val));
        AnnotationUtils.assignFieldParams(parser, params);
        Assert.assertEquals(val, parser.field);
    } catch (Exception e){
        e.printStackTrace();
        Assert.fail("Exception not expected, string is assignable to CharSequence");
    }
    try {
        Date val = new Date();
        params.put("field", new Param<Date>("field", Date.class, val));
        AnnotationUtils.assignFieldParams(parser, params);
        Assert.fail("Exception expected, Date is not assignable to CharSequence.");
    } catch (TikaConfigException e){
        //expected
    }
}