code: public static Instance findScopedInstance( Instance instance ) {
  
  		Instance scopedInstance = instance;
  		while( scopedInstance.getParent() != null
  				&& ! isTarget( scopedInstance ))
  			scopedInstance = scopedInstance.getParent();
  
  		return scopedInstance;
  	}
docs: Finds the scoped instance for an instance (i.e. the agent that manages this instance).
  @param instance an instance (not null)
  @return a non-null instance, the scoped instance