public MediaType detect(InputStream stream, Metadata metadata) throws IOException {
        if (stream != null) {
            try {
                stream.mark(1);
                if (stream.read() == -1) {
                    return MediaType.EMPTY;
                }
            } finally {
                stream.reset();
            }
        }
        return MediaType.OCTET_STREAM;
    }
@Test
    public void testDetectNonZeroValue() {
        byte[] data = "Testing 1...2...3".getBytes(UTF_8);
        detect(data, MediaType.OCTET_STREAM);
    }