public AgeRecogniser() {
        try {
            secondaryParser = new Tika(new TikaConfig());
            available = true;
        } catch (Exception e) {
            available = false;
            LOG.error("Unable to initialize secondary parser", e);
        }
    }
@Test
    public void testAgeRecogniser() throws Exception {

        //test config is added to resources directory
        try (InputStream is = getResourceAsStream(CONFIG_FILE);
                InputStream bis = new ByteArrayInputStream(
                        TEST_TEXT.getBytes(StandardCharsets.UTF_8))) {
            TikaConfig config = new TikaConfig(is);
            Tika tika = new Tika(config);

            Metadata md = new Metadata();
            tika.parse(bis, md);

            assertArrayEquals(new String[]{CompositeParser.class.getCanonicalName(),
                            AgeRecogniser.class.getCanonicalName()},
                    md.getValues(TikaCoreProperties.TIKA_PARSED_BY),
                    "Age Parser not invoked.");
            assertArrayEquals(
                    new String[]{Double.toString(TEST_AGE)},
                    md.getValues(AgeRecogniser.MD_KEY_ESTIMATED_AGE),
                    "Wrong age predicted.");
        }
    }