docs: @SuppressWarnings("unchecked")
  	protected boolean addService(Class serviceClass, BeanContextServiceProvider provider, boolean fireEvent)
  	{
  		if (serviceClass == null || provider == null)
  		{
  			throw new NullPointerException();
  		}
  
  		synchronized (globalHierarchyLock)
  		{
  			synchronized (services)
  			{
  				if (services.containsKey(serviceClass))
  				{
  					return false;
  				}
  				// add to services
  				services.put(serviceClass, createBCSSServiceProvider(serviceClass, provider));
  				// count Serializable
  				if (provider instanceof Serializable)
  				{
  					serializable++;
  				}
  			}
  		}
  
  		if (fireEvent)
  		{
  			// notify all listeners and BeanContextServices children
  			notifyServiceAvailable(new BeanContextServiceAvailableEvent(this, serviceClass));
  		}
  		return true;
  	}