### Question:
IncrementalRelativeFileSets { public static int getBaseDirectoryCount(@NonNull ImmutableMap<RelativeFile, FileStatus> set) { return set.keySet() .stream() .map(RelativeFile::getBase) .filter(Files.isDirectory()) .collect(Collectors.toSet()) .size(); } private  IncrementalRelativeFileSets(); @NonNull static ImmutableMap<RelativeFile, FileStatus> fromDirectory(@NonNull File directory); @NonNull static ImmutableMap<RelativeFile, FileStatus> fromZip(@NonNull File zip); @NonNull static ImmutableMap<RelativeFile, FileStatus> fromZip(
            @NonNull File zip,
            FileStatus status); @NonNull static ImmutableMap<RelativeFile, FileStatus> fromZip(
            @NonNull File zip,
            @NonNull FileCacheByPath cache,
            @NonNull Set<Runnable> cacheUpdates); @NonNull static ImmutableMap<RelativeFile, FileStatus> union(
            @NonNull Iterable<ImmutableMap<RelativeFile, FileStatus>> sets); static int getBaseDirectoryCount(@NonNull ImmutableMap<RelativeFile, FileStatus> set); @NonNull static ImmutableMap<RelativeFile, FileStatus> fromZipsAndDirectories(
            @NonNull Iterable<File> files); @NonNull static ImmutableMap<RelativeFile, FileStatus> makeFromBaseFiles(
            @NonNull Collection<File> baseFiles,
            @NonNull Map<File, FileStatus> updates,
            @NonNull FileCacheByPath cache,
            @NonNull Set<Runnable> cacheUpdates,
            @NonNull FileDeletionPolicy fileDeletionPolicy);  }### Answer:
@Test public void baseDirectoryCountOnEmpty() { ImmutableMap<RelativeFile, FileStatus> set = ImmutableMap.copyOf( Maps.<RelativeFile, FileStatus>newHashMap()); assertEquals(0, IncrementalRelativeFileSets.getBaseDirectoryCount(set)); }