@Test
public void testXMLReaderUtils() throws Exception {

    //pool size may have been reset already by an
    //earlier test.  Can't test for default here.
    assertEquals(XMLReaderUtils.DEFAULT_MAX_ENTITY_EXPANSIONS, XMLReaderUtils.getMaxEntityExpansions());
    //make sure that detection on this file actually works with
    //default expansions
    assertEquals("application/rdf+xml", detect("test-difficult-rdf1.xml", TikaConfig.getDefaultConfig()).toString());
    TikaConfig tikaConfig = getConfig("TIKA-2732-xmlreaderutils.xml");
    try {
        assertEquals(33, XMLReaderUtils.getPoolSize());
        assertEquals(5, XMLReaderUtils.getMaxEntityExpansions());
        //make sure that there's actually a change in behavior
        assertEquals("text/plain", detect("test-difficult-rdf1.xml", tikaConfig).toString());
    } finally {
        XMLReaderUtils.setMaxEntityExpansions(XMLReaderUtils.DEFAULT_MAX_ENTITY_EXPANSIONS);
        XMLReaderUtils.setPoolSize(XMLReaderUtils.DEFAULT_POOL_SIZE);
    }
}