code: private Set<ResourceWorkerSlot> removeWorkerFromSrcPool(int taskNum, ResourceWorkerSlot worker) {
          Set<ResourceWorkerSlot> ret = new HashSet<>();
  
          if (leftTaskNum <= 0) {
              if (taskNum >= avgTaskNum) {
                  taskContext.getWorkerToTaskNum().remove(worker);
                  assignments.add(worker);
                  ret.add(worker);
              }
          } else {
              if (taskNum > avgTaskNum) {
                  taskContext.getWorkerToTaskNum().remove(worker);
                  leftTaskNum = leftTaskNum - (taskNum - avgTaskNum);
                  assignments.add(worker);
                  ret.add(worker);
              }
              if (leftTaskNum <= 0) {
                  List<ResourceWorkerSlot> needDelete = new ArrayList<>();
                  for (Entry<ResourceWorkerSlot, Integer> entry : taskContext.getWorkerToTaskNum().entrySet()) {
                      if (avgTaskNum != 0 && entry.getValue() == avgTaskNum)
                          needDelete.add(entry.getKey());
                  }
                  for (ResourceWorkerSlot workerToDelete : needDelete) {
                      taskContext.getWorkerToTaskNum().remove(workerToDelete);
                      assignments.add(workerToDelete);
                      ret.add(workerToDelete);
                  }
              }
          }
  
          return ret;
      }
docs: /*
  Remove the worker from source worker pool, if the worker is assigned with enough tasks