class CompositeEventListener implements EventListener {

    private List<EventListener> eventListeners = new CopyOnWriteArrayList<>();

    @Override
    public void onEvent(EventType type, EventContext context) {
        for (EventListener eventListener : eventListeners) {
            eventListener.onEvent(type, context);
        }
    }

    public void addListener(EventListener eventListener) {<FILL_FUNCTION_BODY>}
}

        eventListeners.add(eventListener);
        eventListeners.sort(Comparator.comparingLong(e -> e instanceof Ordered ? ((Ordered) e).getOrder() : Ordered.LOWEST_PRECEDENCE));
    
<no_super_class>