@Test
  public void testCopy_withReplaceExisting() throws IOException {
    Files.createFile(path("/bar"));
    Files.createDirectory(path("/test"));

    assertThatPath("/bar").isRegularFile();

    // overwrite regular file w/ directory
    Files.copy(path("/test"), path("/bar"), REPLACE_EXISTING);

    assertThatPath("/bar").isDirectory();

    byte[] bytes = {0, 1, 2, 3};
    Files.write(path("/baz"), bytes);

    // overwrite directory w/ regular file
    Files.copy(path("/baz"), path("/bar"), REPLACE_EXISTING);

    assertThatPath("/bar").containsSameBytesAs("/baz");
  }
");
    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