@Test
    public void testEmptyDocument() throws IOException {
        assertEquals(MediaType.OCTET_STREAM,
                detector.detect(new ByteArrayInputStream(new byte[0]), new Metadata()));

    }
Test for type detection of empty documents.
tika-core/src/test/java/org/apache/tika/detect/MimeDetectionWithNNTest.java