code: public static JobResult createFrom(AccessExecutionGraph accessExecutionGraph) {
  		final JobID jobId = accessExecutionGraph.getJobID();
  		final JobStatus jobStatus = accessExecutionGraph.getState();
  
  		checkArgument(
  			jobStatus.isGloballyTerminalState(),
  			"The job " + accessExecutionGraph.getJobName() + '(' + jobId + ") is not in a globally " +
  				"terminal state. It is in state " + jobStatus + '.');
  
  		final JobResult.Builder builder = new JobResult.Builder();
  		builder.jobId(jobId);
  
  		builder.applicationStatus(ApplicationStatus.fromJobStatus(accessExecutionGraph.getState()));
  
  		final long netRuntime = accessExecutionGraph.getStatusTimestamp(jobStatus) - accessExecutionGraph.getStatusTimestamp(JobStatus.CREATED);
  		// guard against clock changes
  		final long guardedNetRuntime = Math.max(netRuntime, 0L);
  		builder.netRuntime(guardedNetRuntime);
  		builder.accumulatorResults(accessExecutionGraph.getAccumulatorsSerialized());
  
  		if (jobStatus != JobStatus.FINISHED) {
  			final ErrorInfo errorInfo = accessExecutionGraph.getFailureInfo();
  
  			if (errorInfo != null) {
  				builder.serializedThrowable(errorInfo.getException());
  			}
  		}
  
  		return builder.build();
  	}
docs: Creates the {@link JobResult} from the given {@link AccessExecutionGraph} which
  must be in a globally terminal state.
  
  @param accessExecutionGraph to create the JobResult from
  @return JobResult of the given AccessExecutionGraph