@Test
  public void testFileSystemForCustomConfiguration() throws IOException {
    FileTimeSource fileTimeSource = new FakeFileTimeSource();
    Configuration config =
        Configuration.builder(PathType.unix())
            .setRoots("/")
            .setWorkingDirectory("/hello/world")
            .setNameCanonicalNormalization(NFD, CASE_FOLD_UNICODE)
            .setNameDisplayNormalization(NFC)
            .setPathEqualityUsesCanonicalForm(true)
            .setBlockSize(10)
            .setMaxSize(100)
            .setMaxCacheSize(50)
            .setAttributeViews("unix")
            .setDefaultAttributeValue(
                "posix:permissions", PosixFilePermissions.fromString("---------"))
            .setFileTimeSource(fileTimeSource)
            .build();

    FileSystem fs = Jimfs.newFileSystem(config);

    assertThat(fs.getRootDirectories())
        .containsExactlyElementsIn(ImmutableList.of(fs.getPath("/")))
        .inOrder();
    assertThatPath(fs.getPath("").toRealPath()).isEqualTo(fs.getPath("/hello/world"));
    assertThat(Iterables.getOnlyElement(fs.getFileStores()).getTotalSpace()).isEqualTo(100);
    assertThat(fs.supportedFileAttributeViews()).containsExactly("basic", "owner", "posix", "unix");

    Files.createFile(fs.getPath("/foo"));
    assertThat(Files.getAttribute(fs.getPath("/foo"), "posix:permissions"))
        .isEqualTo(PosixFilePermissions.fromString("---------"));
    assertThat(Files.getAttribute(fs.getPath("/foo"), "creationTime"))
        .isEqualTo(fileTimeSource.now());

    try {
      Files.createFile(fs.getPath("/FOO"));
      fail();
    } catch (FileAlreadyExistsException expected) {
    }
  }
Tests for {@link Configuration}, {@link Configuration.Builder} and file systems created from
them.

@author Colin Decker
jimfs/src/test/java/com/google/common/jimfs/ConfigurationTest.java