docs: @SuppressWarnings("unchecked")
  	public <T extends EventListener> T[] getListeners(Class<T> type) {
  		final Object[] iListeners = this.listeners;
  		final int listenerCount = getListenerCount(iListeners, type);
  		final T[] result = (T[]) Array.newInstance(type, listenerCount);
  		int j = 0;
  		for (int i = iListeners.length - 2; i >= 0; i -= 2) {
  			if (iListeners[i] == type) {
  				result[j++] = type.cast(iListeners[i + 1]);
  			}
  		}
  		return result;
  	}