@Test
    public void testDetectNull() throws Exception {
        MediaType html = new MediaType("text", "html");
        Detector detector = new MagicDetector(html, "<html".getBytes(US_ASCII));
        assertEquals(MediaType.OCTET_STREAM, detector.detect(null, new Metadata()));
    }
Test cases for the {@link MagicDetector} class.
tika-core/src/test/java/org/apache/tika/detect/MagicDetectorTest.java