code: public Job insertJobOrFetchDuplicate(String projectId, Job job) throws IOException {
      Preconditions.checkArgument(
          job.getJobReference() != null && job.getJobReference().getJobId() != null,
          "Require non-null JobReference and JobId inside; getJobReference() == '%s'",
          job.getJobReference());
      Insert insert = service.jobs().insert(projectId, job);
      Job response = null;
      try {
        response = insert.execute();
        logger.atFine().log("Successfully inserted job '%s'. Response: '%s'", job, response);
      } catch (IOException ioe) {
        if (errorExtractor.itemAlreadyExists(ioe)) {
          logger.atInfo().withCause(ioe).log(
              "Fetching existing job after catching exception for duplicate jobId '%s'",
              job.getJobReference().getJobId());
          response = service.jobs().get(projectId, job.getJobReference().getJobId()).execute();
        } else {
          throw new IOException(
              String.format("Unhandled exception trying to insert job '%s'", job), ioe);
        }
      }
      checkJobIdEquality(job, response);
      return response;
    }
docs: Tries to run jobs().insert(...) with the provided {@code projectId} and {@code job}, which
  returns a {@code Job} under normal operation, which is then returned from this method.
  In case of an exception being thrown, if the cause was "409 conflict", then we issue a
  separate "jobs().get(...)" request and return the results of that fetch instead.
  Other exceptions propagate out as normal.