private List<SimpleWatchEvent> deDupEvents(final List<SimpleWatchEvent> events) {
        if (NullSafe.hasItems(events)) {
            final Path firstPath = events.getFirst().path;
            EventType lastEventType = null;
            final List<SimpleWatchEvent> filteredEvents = new ArrayList<>(events.size());
            if (events.getLast().eventType == EventType.DELETE) {
                // DELETE is last so can ignore all other events
                filteredEvents.add(events.getLast());
            } else {
                for (final SimpleWatchEvent event : events) {
                    if (!Objects.equals(firstPath, event.path)) {
                        throw new RuntimeException("All paths should be the same in this list.");
                    }
                    // Drop latest one in MODIFY,MODIFY or CREATE,MODIFY
                    if (event.eventType == lastEventType
                        || (event.eventType == EventType.MODIFY && lastEventType == EventType.CREATE)) {
                        LOGGER.debug("Dropping event {}", event);
                    } else {
                        filteredEvents.add(event);
                        lastEventType = event.eventType;
                    }
                }
            }
            return filteredEvents;
        } else {
            return events;
        }
    }
Starts the object. Called <i>before</i> the application becomes available.
stroom-util/src/main/java/stroom/util/io/AbstractDirChangeMonitor.java