public ResourcePoolsBuilder withReplacing(ResourcePool resourcePool) {
    Map<ResourceType<?>, ResourcePool> newPools = new HashMap<>(resourcePools);
    newPools.put(resourcePool.getType(), resourcePool);
    return new ResourcePoolsBuilder(newPools);
  }
public ResourcePoolsBuilder withReplacing ( ResourcePool resourcePool ) { Map < ResourceType < ? > , ResourcePool > newPools = new HashMap < > ( resourcePools ) ; newPools . put ( resourcePool . getType ( ) , resourcePool ) ; return new ResourcePoolsBuilder ( newPools ) ; }
Add or replace the {@link ResourcePool} of {@link ResourceType} in the returned builder.

@param resourcePool the non-{@code null} resource pool to add/replace
@return a new builder with the added pool