code: public void removeLayerFromCache(LayerImpl layer) {
  		if (layer.getId() != layerId) {
  			throw new IllegalStateException();
  		}
  		LayerCacheImpl layerCache = layerCacheRef.get();
  		if (layerCache != null) {
  			layerCache.remove(layer.getKey(), layer);
  		}
  	}
docs: Convenience method to remove the layer that this class is associated with
  from the layer cache.
  
  @param layer
  The layer to remove. The id of the specified layer must be the
  same as <code>layerId</code> or else a
  {@link IllegalStateException} is thrown