@Test
public void should_only_merge_consecutive_events_for_a_file() {

	TestFileWatchEventCoalescor watchEventCoalescor = new TestFileWatchEventCoalescor();
	watchEventCoalescor.post("tmp/foo", StandardWatchEventKinds.ENTRY_MODIFY);
	FileWatchEvent noise1 = watchEventCoalescor.post("tmp/bar", StandardWatchEventKinds.ENTRY_CREATE);// just to add some noise
	watchEventCoalescor.post("tmp/foo", StandardWatchEventKinds.ENTRY_DELETE);
	watchEventCoalescor.post("tmp/foo", StandardWatchEventKinds.ENTRY_MODIFY);
	watchEventCoalescor.post("tmp/bar", StandardWatchEventKinds.ENTRY_CREATE);// just to add some noise
	watchEventCoalescor.post("tmp/foo", StandardWatchEventKinds.ENTRY_CREATE);
	watchEventCoalescor.post("tmp/foo", StandardWatchEventKinds.ENTRY_CREATE);
	assertThat(watchEventCoalescor.removeNoise(noise1)).isTrue(); // remove noisy event (only one, they have been merged)
	assertThat(watchEventCoalescor.scheduledEvents).hasSize(4); // MODIFY, DELETE, MODIFY, CREATE
	assertThat(watchEventCoalescor.scheduledEvents).extracting("reference").extracting("kind")
			.containsExactly(
					StandardWatchEventKinds.ENTRY_MODIFY,
					StandardWatchEventKinds.ENTRY_DELETE,
					StandardWatchEventKinds.ENTRY_MODIFY,
					StandardWatchEventKinds.ENTRY_CREATE
			);
}