private static void assertDeserializeFromFile(Path path, Document document, TestDocumentFactory factory) throws IOException {
        byte[] buf = Files.readAllBytes(path);
        Document deserializedDocument = deserializeDocument(buf, factory);
        assertEquals(path.toString(), document, deserializedDocument);
    }
Helper class with utils used in serialization and deserialization test cases.

@author geirst
document/src/test/java/com/yahoo/document/serialization/SerializationTestUtils.java