class ListUtils {

  public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList() {
    return Collector.<T, List<T>, ImmutableList<T>>of(
        ArrayList::new,
        List::add,
        (left, right) -> {
          left.addAll(right);
          return left;
        },
        ImmutableList::copyOf
    );
  }

  private  ListUtils();

}