code: public <T> void addListener(final Listener<T> listener, final Object instance) {
  		final ListenerInstancePair<T> pair = new ListenerInstancePair<T>(listener, instance);
  		this.listeners.add(pair);
  		final Type observableType = GenericsUtil.getEntityGenericType(listener.getClass(), 0, Listener.class);
  		final Class<?> observable = GenericsUtil.guessClazz(observableType);
  		if (!this.cachedListeners.containsKey(observable)) {
  			this.cachedListeners.put(observable, new LinkedList<ListenerInstancePair<?>>());
  		}
  		for (final Map.Entry<Class<?>, List<ListenerInstancePair<?>>> entry : this.cachedListeners.entrySet()) {
  			final Class<?> type = entry.getKey();
  			if (observable.isAssignableFrom(type)) {
  				entry.getValue().add(pair);
  			}
  		}
  	}
docs: Adds a listener.
  
  @param listener
  The listener.
  @param instance
  The instance associated with this listener.
  @param <T>
  The listener event type.