code: private synchronized void updateStatus(JobStatus _newStatus) {
  
      // generate a new event ID (always increasing).
      JobStatus newStatus = _newStatus.withNewEventId();
  
      UUID jobId = newStatus.getJobId();
  
      // remove the last event for the same job, as it is no longer relevant.
      JobStatus oldStatus = statusByJobId.get(jobId);
      if (oldStatus != null) {
        statusByEventId.remove(oldStatus.getEventId());
      }
  
      // insert event into lookup tables.
      statusByEventId.put(newStatus.getEventId(), newStatus);
      statusByJobId.put(jobId, newStatus);
  
      // wake up any listeners.
      notifyAll();
  
    }
docs: Submits a new <code>JobStatus</code> event.
  @param _newStatus The new <code>JobStatus</code> event.