@Test
public void addMissingFileParents() throws IOException {

    InputStream inputStream = new NamedGraphBuilder()
            .fileCollection(f -> {})
            .file(f -> f.path("file:///foo"))
            .relateToFirst(FileCollection.class, FileCollection::base)
            .file(f -> f.path("file:///foo/bar/gus/one/more"))
            .file(f -> f.path("file:///foo/bar"))
            .file(f -> f.path("file:///foo/bar/gus/two/more"))
            .build();
    BlackDuckIo bdio = graph.io(testBdio());
    bdio.readGraph(inputStream, null, null);
    spi(bdio, graph.traversal().withStrategies(testImplicitConstant())).addMissingFileParents();
    GraphTraversalSource g = graph.traversal();
    // There were 3 files that should have been created
    assertThat(g.V().hasLabel(Bdio.Class.File.name()).has(TT.implicit).count().next())
            .named("implicit file count").isEqualTo(3);
    // Make sure we can traverse from the project to the leaves
    List<Object> leafPaths = g.V()
            .hasLabel(Bdio.Class.FileCollection.name())
            .out(Bdio.ObjectProperty.base.name())
            .repeat(in(Bdio.ObjectProperty.parent.name()))
            .until(not(in(Bdio.ObjectProperty.parent.name())))
            .values(Bdio.DataProperty.path.name())
            .toList();
    assertThat(leafPaths).containsExactly("file:///foo/bar/gus/one/more", "file:///foo/bar/gus/two/more");
    // Make sure we can traverse from the leaves to the base directory (AND NO FURTHER!)
    List<Object> rootPaths = g.V()
            .hasLabel(Bdio.Class.File.name())
            .not(inE(Bdio.ObjectProperty.parent.name()))
            .repeat(out(Bdio.ObjectProperty.parent.name()))
            .until(not(out(Bdio.ObjectProperty.parent.name())))
            .dedup()
            .values(Bdio.DataProperty.path.name())
            .toList();
    assertThat(rootPaths).containsExactly("file:///foo");
}