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 .