EventWatcher[] () { final ArrayList<EventWatcher> watchers = new ArrayList<>(); if (EventWatcher.isEnabledDetailed) { watchers.add(new DetailedEventWatcher()); } if (EventWatcher.isEnabledAggregated) { watchers.add(new OtelReportingEventWatcher()); } return watchers.toArray(EventWatcher[]::new); }