Bug 87856 [Commands] Last closed editor leaked due to reference by command manager
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/CommandManager.java
/**
	 * The set of identifiers for those categories that are defined. This value
	 * may be empty, but it is never <code>null</code>.
	 */
	private final Set definedCategoryIds = new HashSet();
	/**
	 * The set of identifiers for those commands that are defined. This value
	 * may be empty, but it is never <code>null</code>.
	 */
	private final Set definedCommandIds = new HashSet();
	/**
	 * The collection of listener to this command manager. This collection is
	 * <code>null</code> if there are no listeners.
	 */
	private Collection listeners = null;
	/**
	 * Adds a listener to this command manager. The listener will be notified
	 * when the set of defined commands changes. This can be used to track the
	 * global appearance and disappearance of commands.
	 * 
	 * @param listener
	 *            The listener to attach; must not be <code>null</code>.
	 */
	public final void addCommandManagerListener(
			final ICommandManagerListener listener) {
		if (listener == null) {
			throw new NullPointerException();
		}
		if (listeners == null) {
			listeners = new HashSet();