class Lists {

  public static <X, Y> Y foldLeft(Y initial, List<X> inputList, Aggregator<? super X, Y> op) {
    if (null == inputList) {
      return initial;
    }

    Y next = initial;
    for (X val : inputList) {
      next = op.eval(val, next);
    }

    return next;
  }

  private  Lists();

}