FileDeletionTask extends DeletionTask implements Runnable { 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(); } FileDeletionTask(DeletionService deletionService, String user,
      Path subDir, List<Path> baseDirs);  FileDeletionTask(int taskId, DeletionService deletionService,
      String user, Path subDir, List<Path> baseDirs); Path getSubDir(); List<Path> getBaseDirs(); @Override void run(); @Override String toString(); DeletionServiceDeleteTaskProto convertDeletionTaskToProto();  }
@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()); }