@Override
  public alluxio.grpc.JobInfo toProto() throws IOException {
    List<alluxio.grpc.JobInfo> taskInfos = new ArrayList<>();
    for (JobInfo taskInfo : mChildren) {
      taskInfos.add(taskInfo.toProto());
    }
    alluxio.grpc.JobInfo.Builder jobInfoBuilder = alluxio.grpc.JobInfo.newBuilder().setId(mId)
        .setErrorMessage(mErrorMessage).addAllChildren(taskInfos).setStatus(mStatus.toProto())
        .setName(mName).setDescription(mDescription).addAllAffectedPaths(mAffectedPaths)
        .setErrorType(mErrorType).setType(JobType.PLAN);
    if (mResult != null && !mResult.isEmpty()) {
      ByteBuffer result =
          mResult == null ? null : ByteBuffer.wrap(SerializationUtils.serialize(mResult));
      jobInfoBuilder.setResult(ByteString.copyFrom(result));
    }
    jobInfoBuilder.setLastUpdated(mLastUpdated);

    return jobInfoBuilder.build();
  }
@Test
  public void testToProto() throws IOException {
    PlanInfo planInfo = new PlanInfo(1, "test", Status.COMPLETED, 10, null);
    PlanInfo otherPlanInfo = new PlanInfo(planInfo.toProto());

    assertEquals(planInfo, otherPlanInfo);
  }