This is not a new problem but I am concerned about losing events (or emitting unexpected events if an event appears between the clear and the first add in `addAll()`).

We either need to atomically replace `this.eventTypes` (change it to `volatile`), or add a barrier to `onApplicationEvent` to prevent it from proceeding while `this.eventTypes` is being rebuilt. However, we shouldn't always synchronize `onApplicationEvent`; only while the rebuild is happening.