public GetWorkerReportPOptions toProto() {
    GetWorkerReportPOptions.Builder optionsBuilder = GetWorkerReportPOptions.newBuilder();
    optionsBuilder.addAllAddresses(mAddresses);
    if (mFieldRange != null) {
      Set<alluxio.grpc.WorkerInfoField> protoFieldRange = new HashSet<>();
      for (WorkerInfoField field : mFieldRange) {
        protoFieldRange.add(field.toProto());
      }
      optionsBuilder.addAllFieldRanges(protoFieldRange);
    }
    optionsBuilder.setWorkerRange(mWorkerRange.toProto());
    return optionsBuilder.build();
  }
@Test
  public void identicalFieldsForWorkerInfoAndRange() {
    for (GetWorkerReportOptions.WorkerInfoField field :
            GetWorkerReportOptions.WorkerInfoField.values()) {
      Assert.assertEquals(field, GetWorkerReportOptions
              .WorkerInfoField.fromProto(field.toProto()));
    }
    for (GetWorkerReportOptions.WorkerRange range : GetWorkerReportOptions.WorkerRange.values()) {
      Assert.assertEquals(range, GetWorkerReportOptions.WorkerRange.fromProto(range.toProto()));
    }

    for (WorkerInfoField field : WorkerInfoField.values())  {
      Assert.assertEquals(field,
              GetWorkerReportOptions.WorkerInfoField.fromProto(field).toProto());
    }
    for (WorkerRange range : WorkerRange.values())  {
      Assert.assertEquals(range, GetWorkerReportOptions.WorkerRange.fromProto(range).toProto());
    }
  }