### Question:
S3FileSystem extends FileSystem implements Comparable<S3FileSystem> { @Override public Iterable<Path> getRootDirectories() { ImmutableList.Builder<Path> builder = ImmutableList.builder(); for (FileStore fileStore : getFileStores()) { builder.add(((S3FileStore) fileStore).getRootDirectory()); } return builder.build(); } S3FileSystem(S3FileSystemProvider provider, String key, AmazonS3 client, String endpoint); @Override S3FileSystemProvider provider(); String getKey(); @Override void close(); @Override boolean isOpen(); @Override boolean isReadOnly(); @Override String getSeparator(); @Override Iterable<Path> getRootDirectories(); @Override Iterable<FileStore> getFileStores(); @Override Set<String> supportedFileAttributeViews(); @Override S3Path getPath(String first, String... more); @Override PathMatcher getPathMatcher(String syntaxAndPattern); @Override UserPrincipalLookupService getUserPrincipalLookupService(); @Override WatchService newWatchService(); AmazonS3 getClient(); String getEndpoint(); String[] key2Parts(String keyParts); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(S3FileSystem o); int getCache();  }### Answer:
@Test public void getRootDirectories() { Iterable<Path> paths = fs.getRootDirectories(); assertNotNull(paths); int size = 0; boolean bucketNameA = false; boolean bucketNameB = false; for (Path path : paths) { S3Path s3Path = (S3Path)path; String fileStore = s3Path.getFileStore().name(); Path fileName = s3Path.getFileName(); if (fileStore.equals("bucketA") && fileName == null) { bucketNameA = true; } else if (fileStore.equals("bucketB") && fileName == null) { bucketNameB = true; } size++; } assertEquals(2, size); assertTrue(bucketNameA); assertTrue(bucketNameB); }