@Test
public void implyFileSystemType() 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"))
            .file(f -> f.path("file:///foo/gus").linkPath("file:///foo/bar"))
            .file(f -> f.path("file:///foo/bar/test.bin"))
            .file(f -> f.path("file:///foo/bar/test.zip").byteCount(1L))
            .file(f -> f.path("zip:file:%2F%2F%2Ffoo%2Fbar%2Ftest.zip#test.txt").encoding("UTF-8"))
            .build();
    BlackDuckIo bdio = graph.io(testBdio(TT.Metadata, TT.root));
    bdio.readGraph(inputStream, null, null);
    BlackDuckIoNormalizationSpi spi = spi(bdio, graph.traversal().withStrategies(testImplicitConstant()));
    spi.addMissingFileParents();
    spi.implyFileSystemTypes();
    GraphTraversalSource g = graph.traversal();
    List<Vertex> files = g.V().hasLabel(Bdio.Class.File.name()).toList();
    for (Vertex file : files) {
        VertexProperty<String> fileSystemType = file.property(Bdio.DataProperty.fileSystemType.name());
        assertThat(fileSystemType.isPresent()).isTrue();
        String path = file.value(Bdio.DataProperty.path.name());
        if (path.equals("file:///foo")) {
            assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.DIRECTORY.toString());
        } else if (path.equals("file:///foo/bar")) {
            assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.DIRECTORY.toString());
        } else if (path.equals("file:///foo/gus")) {
            assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.SYMLINK.toString());
        } else if (path.equals("file:///foo/bar/test.bin")) {
            assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.REGULAR.toString());
        } else if (path.equals("file:///foo/bar/test.zip")) {
            assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.DIRECTORY_ARCHIVE.toString());
        } else if (path.equals("zip:file:%2F%2F%2Ffoo%2Fbar%2Ftest.zip#test.txt")) {
            assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.REGULAR_TEXT.toString());
        }
    }
}