@Override
  protected synchronized void updateJob(
      UUID jobId, PortabilityJob job, JobUpdateValidator validator) throws IOException {
    Preconditions.checkNotNull(jobId);
    try {
      Map<String, Object> previousEntry = JOB_MAP.replace(jobId, job.toMap());
      if (previousEntry == null) {
        throw new IOException("jobId: " + jobId + " didn't exist in the map");
      }
      if (validator != null) {
        PortabilityJob previousJob = PortabilityJob.fromMap(previousEntry);
        validator.validate(previousJob, job);
      }
    } catch (NullPointerException | IllegalStateException e) {
      throw new IOException("Couldn't update jobId: " + jobId, e);
    }
  }
Verifies a {@code PortabilityJob} already exists for {@code jobId}, and updates the entry to
{@code job}. If {@code validator} is non-null, validator.validate() is called first, as part of
the atomic update.

@throws IOException if a job didn't already exist for {@code jobId} or there was a problem
    updating it
@throws IllegalStateException if validator.validate() failed
extensions/cloud/portability-cloud-local/src/main/java/org/datatransferproject/cloud/local/LocalJobStore.java