class FunctionUtils {

  public static <T> Collector<T, List<T>, ScenarioArray<T>> toScenarioArray() {
    // edited to compile in Eclipse
    return Collector.of(
        ArrayList<T>::new,
        (a, b) -> a.add(b),
        (l, r) -> {
          l.addAll(r);
          return l;
        },
        list -> buildResult(list));
  }

  private  FunctionUtils();

}