private static Promise<ProjectTaskManager.Result> rebuild(List<Module> modules, ProjectTaskManager projectTaskManager) {
    return modules.isEmpty() ? projectTaskManager.rebuildAllModules() : projectTaskManager.rebuild(modules.toArray(Module.EMPTY_ARRAY));
  }
private static Promise<ProjectTaskManager.Result> rebuild(List<Module> modules, ProjectTaskManager projectTaskManager)