class EventSpyImpl implements EventSpy {

    private DefaultSessionFactory sessionFactory;

    @Inject
    EventSpyImpl(DefaultSessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    @Override
    public void init(Context context) throws Exception {}

    @Override
    public void onEvent(Object arg) throws Exception {<FILL_FUNCTION_BODY>}

    @Override
    public void close() throws Exception {}
}

        if (arg instanceof ExecutionEvent) {
            ExecutionEvent ee = (ExecutionEvent) arg;
            InternalMavenSession session =
                    InternalMavenSession.from(ee.getSession().getSession());
            Collection<Listener> listeners = session.getListeners();
            if (!listeners.isEmpty()) {
                Event event = new DefaultEvent(session, ee);
                for (Listener listener : listeners) {
                    listener.onEvent(event);
                }
            }
        }
    
<no_super_class>