@Test
public void should_create_an_observer_that_notify_when_a_file_is_modified() throws Exception {

    Files.write(monitoredFolder.resolve("aFile"), "coucou".getBytes());
    FileAlterationObserver observer = factory.create(monitoredFolder, listener);
    Files.write(monitoredFolder.resolve("aFile"), "modified content".getBytes());
    observer.checkAndNotify();
    assertThat(listener.getChanged()).containsExactly(monitoredFolder.resolve("aFile"));
}