code: public static List<Integer> getUniformCounts(final int elementCount, final int taskCount) {
      final int quotient = elementCount / taskCount;
      final int remainder = elementCount % taskCount;
  
      final List<Integer> retList = new ArrayList<>();
      for (int taskIndex = 0; taskIndex < taskCount; taskIndex++) {
        if (taskIndex < remainder) {
          retList.add(quotient + 1);
        } else {
          retList.add(quotient);
        }
      }
      return retList;
    }
docs: Uniformly distribute a number of elements across a number of Tasks and return a list of counts.
  If uniform distribution is impossible, then some Tasks will receive one
  more element than others. The sequence of the number of elements for each
  Task is non-increasing.
  
  @param elementCount number of elements to distribute
  @param taskCount number of Tasks that receive elements
  @return list of counts specifying how many elements each Task should receive