Getting a set of subscribers from a subscriberMap
private &lt;E extends Event&gt; void checkSubscriberMap(Class&lt;E&gt; type)


This method checks nothing. It ensures that there's a non-null value. Or it fixes or prepares something.

Note that you're using both contains and get every time. I guess, a method like

private &lt;E extends Event&gt; Set&lt;E&gt; safeGet(Class&lt;E&gt; type) {
   Set&lt;E&gt; result =
           (Set&lt;Subscriber&lt;E&gt;&gt;) (Object) subscriberMap.get(type);
   if (result == null) {
        result = new HashSet&lt;&gt;();
        subscriberMap.put(type, result);
   }
   return result;
}


would be better.

Consider using Guava's Multimap as it's been solved there.



@SuppressWarnings("unchecked")
private &lt;E extends Event&gt; Set&lt;Subscriber&lt;E&gt;&gt; getSubscribers(E event)
{
    return (Set&lt;Subscriber&lt;E&gt;&gt;) (Object) getSubscribers(event.getClass());
}


I'm afraid, that's right. The ugly double cast is needed as there's no way to tell the compiler that it works. Maybe the intermediate cast could be (non-generic) (Set).




  Assuming nobody uses reflection


If somebody does, that's not your fault.

What you did is similar in idea to the MutableClassToInstanceMap, except that you need Set&lt;Subscriber&lt;E&gt;&gt; instead of E itself and therefore you can't use type.cast(object) and have to resolve to an unchecked cast.