code: private List<WorkUnit> materializeWorkUnitList(WorkUnitStream workUnitStream) {
      if (!workUnitStream.isFiniteStream()) {
        throw new UnsupportedOperationException("Cannot materialize an infinite work unit stream.");
      }
      return Lists.newArrayList(workUnitStream.getWorkUnits());
    }
docs: Materialize a {@link WorkUnitStream} into an in-memory list. Note that infinite work unit streams cannot be materialized.