code: private static List<MultiWorkUnit> bestFitDecreasingBinPacking(List<WorkUnit> workUnits, double avgGroupSize) {
  
      // Sort workunits by data size desc
      Collections.sort(workUnits, LOAD_DESC_COMPARATOR);
  
      PriorityQueue<MultiWorkUnit> pQueue = new PriorityQueue<>(workUnits.size(), LOAD_DESC_COMPARATOR);
      for (WorkUnit workUnit : workUnits) {
        MultiWorkUnit bestGroup = findAndPopBestFitGroup(workUnit, pQueue, avgGroupSize);
        if (bestGroup != null) {
          addWorkUnitToMultiWorkUnit(workUnit, bestGroup);
        } else {
          bestGroup = MultiWorkUnit.createEmpty();
          addWorkUnitToMultiWorkUnit(workUnit, bestGroup);
        }
        pQueue.add(bestGroup);
      }
      return Lists.newArrayList(pQueue);
    }
docs: Group {@link WorkUnit}s into groups. Each group is a {@link MultiWorkUnit}. Each group has a capacity of
  avgGroupSize. If there's a single {@link WorkUnit} whose size is larger than avgGroupSize, it forms a group itself.