@Test
  public void testWrite_fileExistsButIsNotRegularFile() throws IOException {
    Files.createDirectory(path("/foo"));

    try {
      // non-CREATE mode
      Files.write(path("/foo"), preFilledBytes(10), WRITE);
      fail();
    } catch (FileSystemException expected) {
      assertThat(expected.getFile()).isEqualTo("/foo");
      assertThat(expected.getMessage()).contains("regular file");
    }

    try {
      // CREATE mode
      Files.write(path("/foo"), preFilledBytes(10));
      fail();
    } catch (FileSystemException expected) {
      assertThat(expected.getFile()).isEqualTo("/foo");
      assertThat(expected.getMessage()).contains("regular file");
    }
  }
");
    assertThatPath("foo/bar").doesNotMatch("glob:/**");
    assertThatPath("/foo/bar/baz/stuff").matches("glob:/foo/**");
    assertThatPath("/foo/bar/baz/stuff").matches("glob:/*
jimfs/src/test/java/com/google/common/jimfs/JimfsUnixLikeFileSystemTest.java