docs: private List<T> finalizeCurrentBatch() {
      List<T> finalizedList;
      synchronized (items) {
        finalizedList = ImmutableList.copyOf(items);
        items.clear();
              /*
               * To avoid reprocessing being triggered on an empty list.
               */
        cancelTask(maxTask);
        cancelTask(idleTask);
      }
      return finalizedList;
    }