@Test
public void testFileBlobMemoryNodeStore() throws Exception {

    final File blobStoreFile = new File(testOutDir, "testFileBlobMemoryNodeStore/datastore");
    if (blobStoreFile.isDirectory()) {
        FileUtils.deleteDirectory(blobStoreFile);
    }
    final OakMachine.Builder machineBuilder = builder().withNodeStoreSupplier(() ->
            new FileBlobMemoryNodeStore(blobStoreFile.getAbsolutePath()));
    machineBuilder.build().adminInitAndInspect(session -> {
        // less than AbtractBlobStore.minBlockSize - 2 (for varInt length prefix where length >= 128 && < 16384)
        final Binary binary = alphaFill(session, 4093);
        Node fooNode = session.getRootNode().addNode("foo", "nt:unstructured");
        fooNode.setProperty("data", binary);
        session.save();
        assertTrue("blob is retrievable", fooNode.getProperty("data").getString().startsWith("abcdefg"));
    });
    final File[] inlineChildren = blobStoreFile.listFiles();
    assertNotNull("should have non-null inlineChildren", inlineChildren);
    assertEquals("inline children is empty <4k", 0, inlineChildren.length);
    machineBuilder.build().adminInitAndInspect(session -> {
        // bigger than 4096
        final Binary binary = alphaFill(session, 8192);
        assertFalse("/foo should not exist", session.nodeExists("/foo"));
        Node fooNode = session.getRootNode().addNode("foo", "nt:unstructured");
        fooNode.setProperty("data", binary);
        session.save();
        assertTrue("blob is retrievable", fooNode.getProperty("data").getString().startsWith("abcdefg"));
    });
    final File[] blobChildren = blobStoreFile.listFiles();
    assertNotNull("should have non-null blobChildren", blobChildren);
    assertEquals("blobChildren is not empty @>4k", 1, blobChildren.length);
}