code: @VisibleForTesting
  	@Nullable
  	public Instance getInstance(ResourceID resourceId) {
  		for (Instance instance : allInstances) {
  			if (Objects.equals(resourceId, instance.getTaskManagerID())) {
  				return instance;
  			}
  		}
  		return null;
  	}
docs: ------------------------------------------------------------------------