@Test
public void test_hash_with_ocr_and_without_ocr_is_the_same() throws Exception {

    EmbeddedDocumentMemoryExtractor ocrExtractor = new EmbeddedDocumentMemoryExtractor(
            new CommonsDigester(20 * 1024 * 1024, CommonsDigester.DigestAlgorithm.SHA256.toString()), "SHA-256", true);
    EmbeddedDocumentMemoryExtractor noOcrExtractor = new EmbeddedDocumentMemoryExtractor(
            new CommonsDigester(20 * 1024 * 1024, CommonsDigester.DigestAlgorithm.SHA256.toString()), "SHA-256", false);
    assertThat(ocrExtractor.extract(documentFactory.create(Paths.get(getClass().getResource("/documents/embedded_with_duplicate.tgz").getPath())),
            "f35a3e02f71564f653db8d0115fa5caaff27341f5767096242fd90ad6392b81d")).isNotNull();
    assertThat(noOcrExtractor.extract(documentFactory.create(Paths.get(getClass().getResource("/documents/embedded_with_duplicate.tgz").getPath())),
            "f35a3e02f71564f653db8d0115fa5caaff27341f5767096242fd90ad6392b81d")).isNotNull();
    /* should work like this ?
    InputStreamDigester inputStreamDigester = new InputStreamDigester(20 * 1024 * 1024, "SHA-256", Hex::encodeHexString);
    Metadata metadata = new Metadata();
    inputStreamDigester.digest(new ByteArrayInputStream(hexToBin(onePixelJpg)), metadata, new ParseContext());
    assertThat("f35a3e02f71564f653db8d0115fa5caaff27341f5767096242fd90ad6392b81d").isEqualTo(metadata.get("X-TIKA:digest:SHA-256"));
    */
}