class Concurrent::Collection::NonConcurrentMapBackend

def replace_if_exists(key, new_value)

def replace_if_exists(key, new_value)
  if NULL != (stored_value = @backend.fetch(key, NULL))
    @backend[key] = new_value
    stored_value
  end
end