### Question:
PathMatchers { @Factory public static Matcher<Path> exists(LinkOption... options) { return new Exists(options); } PathMatchers(); @Factory static Matcher<Path> contains(String fileName); @Factory static Matcher<Path> isDirectory(); @Factory static Matcher<Path> exists(LinkOption... options); @Factory static Matcher<Path> hasFilesCount(int expectedCount); @Factory static Matcher<Path> hasFilesCount(int expectedCount, String glob);  }### Answer:
@Test public void shouldSymlinkNotExists() throws Exception { Path file = directory.resolve("file"); Path fileLinked = directory.resolve("file-linked"); Files.createSymbolicLink(file, fileLinked); assertThat(file, not(exists())); }
@Test public void shouldSymlinkExistsIfOptionConfigured() throws Exception { Path file = directory.resolve("file"); Path fileLinked = directory.resolve("file-linked"); Files.createSymbolicLink(file, fileLinked); System.out.println(Files.isSymbolicLink(file)); assertThat(file, exists(LinkOption.NOFOLLOW_LINKS)); }
@Test public void shouldExists() throws Exception { Path file = directory.resolve("file"); Files.write(file, "content".getBytes(StandardCharsets.UTF_8)); assertThat(file, exists()); }
@Test(expected = AssertionError.class) public void shouldFailIfNotExists() throws Exception { assertThat(directory.resolve("file"), exists()); }
@Test public void shouldNotExists() throws Exception { Path file = directory.resolve("file"); assertThat(file, not(exists())); }