public static Predicate<Event<?, ?>> withListenerClass(
            Class<? extends Listener> cls) {
        if (cls == null) {
            throw new IllegalArgumentException("cls is null");
        }
        return event -> event.getListenerClass() == cls;
    }
public static Predicate < Event < ? , ? > > withListenerClass ( Class < ? extends Listener > cls ) { if ( cls == null ) { throw new IllegalArgumentException ( "cls is null" ) ; } return event -> event . getListenerClass ( ) == cls ; }
Creates a predicate that matches events for the given listener class.

@param cls The listener class to check for.
@return The predicate.