/*
(non-Javadoc)

@see
javax.persistence.criteria.CriteriaBuilder#max(javax.persistence.criteria
.Expression)
197790
@Override
    public <N extends Number> Expression<N> max(Expression<N> arg0)
    {
        // TODO Auto-generated method stub
        return null;
    }
807754
public static int findMaxIndex( int[] a ) {
		int max = a[0];
		int index = 0;

		for( int i = 1; i< a.length; i++ ) {
			int val = a[i];

			if( val > max ) {
				max = val;
				index = i;
			}
		}

		return index;
	}
564487
public static void checkMinMax(int min, int max) {
    checkMin(min);
    checkMax(max);
    checkArgument(min <= max, "min > max");
  }
847409
public static <T> JDOQuery<T> select(Expression<T> expr) {
        return new JDOQuery<Void>().select(expr);
    }
203862
public SingleOutputStreamOperator<T> max(int positionToMax) {
		return aggregate(new ComparableAggregator<>(positionToMax, input.getType(), AggregationFunction.AggregationType.MAX, input.getExecutionConfig()));
	}
681407
public static Constraint max(final Number max) {
		return new Constraint("max", maxPayload(max)) {
			public boolean isValid(Object actualValue) {
				return actualValue == null || (actualValue instanceof Number && max != null &&
						max.longValue() >= ((Number) actualValue).longValue());
			}
		};
	}
1069173
public void setMaxCoeff(double maxCoeff)
    {
        if(maxCoeff <= 0 || Double.isNaN(maxCoeff) || Double.isInfinite(maxCoeff))
            throw new IllegalArgumentException("MaxCoeff must be positive, not " + maxCoeff);
        this.maxCoeff = maxCoeff;
    }
592712
public static NumberExpression<Double> ymax(GeometryExpression<?> expr) {
        return Expressions.numberOperation(Double.class, SpatialOps.YMAX, expr);
    }
556644
public static int max(int a, int b, int c) {
    int ma;
    ma = a;
    if (b > ma) {
      ma = b;
    }
    if (c > ma) {
      ma = c;
    }
    return ma;
  }
295174
public void setMax(java.lang.Object _max) {
		getStateHelper().put(PropertyKeys.max, _max);
	}
326429
@NonNull
    @Override
    public Limit limit(@NonNull Expression limit) {
        if (limit == null) {
            throw new IllegalArgumentException("limit cannot be null.");
        }
        return new Limit(this, limit, null);
    }
834422
public Query<T> where(io.ebean.Expression expression) {
        return query().where(expression);
    }
1174666
@NonNull
    public static SelectResult.As expression(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new SelectResult.As(expression);
    }
847268
public int getMaxIdx() {
        int max = Integer.MIN_VALUE;
        for (int i=0; i<this.top; i++) {
            if (idx[i] > max) {
                max = idx[i];
            }
        }
        return max;
    }
118468
@NonNull
    public Expression and(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new CompoundExpression(Arrays.asList(this, expression), CompoundExpression.OpType.And);
    }
128166
@NonNull
    public ArrayExpressionSatisfies in(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new ArrayExpressionSatisfies(type, variable, expression);
    }
1271195
public static <T extends Comparable<? super T>> T max(final T[] a) {
        N.checkArgNotNullOrEmpty(a, "The spcified array 'a' can not be null or empty");

        return max(a, 0, a.length);
    }