@Test
public void testMisMatchType() {

    class MyParser extends Configurable {
        @Field(required = true) int config;
    }
    Map<String, Param> params = new HashMap<>();
    try {
        params.put("config", new Param<>("config", 1));
        MyParser bean = new MyParser();
        AnnotationUtils.assignFieldParams(bean, params);
        Assert.assertEquals(bean.config, 1);
    } catch (TikaConfigException e) {
        e.printStackTrace();
        Assert.fail("Exception Not expected");
    }
    params.clear();
    try {
        params.put("config", new Param<>("config", "a string value"));
        AnnotationUtils.assignFieldParams(new MyParser(), params);
        Assert.fail("Exception expected");
    } catch (TikaConfigException e) {
        //expected
    }
}