public DeletionServiceDeleteTaskProto convertDeletionTaskToProto() {
    DeletionServiceDeleteTaskProto.Builder builder =
        getBaseDeletionTaskProtoBuilder();
    builder.setTaskType(DeletionTaskType.FILE.name());
    if (getSubDir() != null) {
      builder.setSubdir(getSubDir().toString());
    }
    if (getBaseDirs() != null) {
      for (Path dir : getBaseDirs()) {
        builder.addBasedirs(dir.toString());
      }
    }
    return builder.build();
  }
@Test
  public void testConvertDeletionTaskToProto() throws Exception {
    DeletionServiceDeleteTaskProto proto =
        deletionTask.convertDeletionTaskToProto();
    assertEquals(ID, proto.getId());
    assertEquals(USER, proto.getUser());
    assertEquals(SUBDIR, new Path(proto.getSubdir()));
    assertEquals(BASEDIR, new Path(proto.getBasedirs(0)));
    assertEquals(1, proto.getBasedirsCount());
  }