package org.jeecqrs.events;

import java.util.Set;

/**
 * Provides the ability to specify which events a listener wants to
 * receive on the event bus.
 * 
 * @param <E>  the message base type
 */
public interface EventBusInterest<E> {

    /**
     * Gets the set of event types the listener is interested in.
     * 
     * @return  the set of event classes
     */
    Set<Class<? extends E>> interestEventTypes();

    /**
     * Tells whether the interest includes the given event type.
     * 
     * @param clazz  the event type
     * @return  {@code true} if the interest includes the given even type
     */
    boolean includes(Class<? extends E> clazz);

}

@@ -43,52 +43,115 @@
 til.
-Set;%0A%0A/**%0A * Provides the ability to s
+Collection;%0Aimport java.util.Collections;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0A/**%0A * S
 pecif
-y
+ies
  whi
@@ -179,19 +179,16 @@
 wants to
-%0A *
  receive
@@ -262,39 +262,243 @@
 lic 
-interface EventBusInterest%3CE%3E %7B
+class EventBusInterest%3CE%3E %7B%0A%0A    private final Set%3CClass%3C? extends E%3E%3E interests;%0A%0A    protected EventBusInterest(Collection%3CClass%3C? extends E%3E%3E types) %7B%0A        this.interests = Collections.unmodifiableSet(new HashSet%3C%3E(types));%0A    %7D
 %0A%0A  
@@ -674,17 +674,55 @@
 tTypes()
-;
+ %7B%0A        return this.interests;%0A    %7D
 %0A%0A    /*
@@ -960,13 +960,67 @@
 %3E clazz)
-;
+ %7B%0A        return this.interests.contains(clazz);%0A    %7D
 %0A%0A%7D%0A

Add EventBusInterest implementation