private EvaluatorHeartbeatProto GetEvaluatorHeartbeatProto(
     EvaluatorStatusProto evaluatorStatusProto,
     ICollection<ContextStatusProto> contextStatusProtos,
     Optional<TaskStatusProto> taskStatusProto)
 {
     EvaluatorHeartbeatProto evaluatorHeartbeatProto = new EvaluatorHeartbeatProto()
     {
         timestamp = CurrentTimeMilliSeconds(),
         evaluator_status = evaluatorStatusProto
     };
     foreach (ContextStatusProto contextStatusProto in contextStatusProtos)
     {
         evaluatorHeartbeatProto.context_status.Add(contextStatusProto);
     }
     if (taskStatusProto.IsPresent())
     {
         evaluatorHeartbeatProto.task_status = taskStatusProto.Value;
     }
     return evaluatorHeartbeatProto;
 }
 /// <summary>
 /// Called with a specific EvaluatorStatus that must be delivered to the driver
 /// </summary>
 /// <param name="evaluatorStatusProto"></param>
 public void OnNext(EvaluatorStatusProto evaluatorStatusProto)
 {
     LOGGER.Log(Level.Verbose, "Before acquiring lock: HeartbeatManager::OnNext(EvaluatorStatusProto)");
     lock (this)
     {
         LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(EvaluatorStatusProto)");
         EvaluatorHeartbeatProto heartbeatProto = new EvaluatorHeartbeatProto()
         {
             timestamp = CurrentTimeMilliSeconds(),
             evaluator_status = evaluatorStatusProto
         };
         LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
         Send(heartbeatProto);
     }
 }