public void add(SQLListener listener) {
        if (listener instanceof SQLListeners) {
            for (SQLListener l : ((SQLListeners) listener).listeners) {
                add(l);
            }
        } else if (listener instanceof SQLDetailedListener) {
            listeners.add((SQLDetailedListener) listener);
        } else {
            listeners.add(new SQLListenerAdapter(listener));
        }
    }
{@code SQLListeners} is a {@link SQLListener} implementation which dispatches the
notifications to a list of SQLListener instances

@author tiwe
querydsl-sql/src/main/java/com/querydsl/sql/SQLListeners.java