source: class BlackDuckIoNormalizationTest  {
  
      @Test
      public void implyFileSystemType_noOverwrite() throws IOException {
  
target:         InputStream inputStream = new NamedGraphBuilder()
                  .fileCollection(f -> {})
                  .file(f -> f.path("file:///foo").fileSystemType(Bdio.FileSystemType.SYMLINK.toString()))
                  .relateToFirst(FileCollection.class, FileCollection::base)
                  .file(f -> f.path("file:///foo/bar").fileSystemType(Bdio.FileSystemType.REGULAR.toString()))
                  .file(f -> f.path("file:///foo/gus").fileSystemType(Bdio.FileSystemType.SYMLINK.toString()))
                  .file(f -> f.path("file:///foo/bar/test.bin").fileSystemType(Bdio.FileSystemType.SYMLINK.toString()))
                  .file(f -> f.path("file:///foo/bar/test.zip").byteCount(1L).fileSystemType(Bdio.FileSystemType.SYMLINK.toString()))
                  .file(f -> f.path("zip:file:%2F%2F%2Ffoo%2Fbar%2Ftest.zip#test.txt").encoding("UTF-8").fileSystemType(Bdio.FileSystemType.SYMLINK.toString()))
                  .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.SYMLINK.toString());
              } else if (path.equals("file:///foo/bar")) {
                  // This is the one exception to the "no overwrite"; a regular file with children is corrected
                  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.SYMLINK.toString());
              } else if (path.equals("file:///foo/bar/test.zip")) {
                  assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.SYMLINK.toString());
              } else if (path.equals("zip:file:%2F%2F%2Ffoo%2Fbar%2Ftest.zip#test.txt")) {
                  assertThat(fileSystemType.value()).isEqualTo(Bdio.FileSystemType.SYMLINK.toString());
              }
          }
      }
  
  }