Crates new {@link Predicate} for {@code RANGE [lowerBound TO upperBound]}

@param lowerBound
@param upperBound
@param includeLowerBound
@param includeUppderBound
@return
971625
public Criteria between(@Nullable Object lowerBound, @Nullable Object upperBound, boolean includeLowerBound, boolean includeUppderBound) {
		predicates.add(new Predicate(OperationKey.BETWEEN,
				new Object[] { lowerBound, upperBound, includeLowerBound, includeUppderBound }));
		return this;
	}
225790
private void storeUpperBound(Token tok, Token simTok, List usefulTokens, Map upperBoundOnWeight, double sim)
    {
        double upperBound = tfidfDistance.getWeight(tok)*maxTFIDFScore[simTok.getIndex()]*sim;
        if (DEBUG) System.out.println("upper-bounding tok "+simTok+" sim="+sim+" to "+tok+" upperBound "+upperBound);
        if (DEBUG) System.out.println("upperBound = "+tfidfDistance.getWeight(tok)+"*"+maxTFIDFScore[simTok.getIndex()]+"*"+sim);
        usefulTokens.add( simTok );
        upperBoundOnWeight.put( simTok, new Double(upperBound) );
    }
953392
public double repairSolutionVariableValue(double value, double lowerBound, double upperBound) {
    if (lowerBound > upperBound) {
      throw new JMetalException("The lower bound (" + lowerBound + ") is greater than the "
          + "upper bound (" + upperBound+")") ;
    }
    double result = value ;
    if (value < lowerBound) {
      result = randomGenerator.getRandomValue(lowerBound, upperBound) ;
    }
    if (value > upperBound) {
      result = randomGenerator.getRandomValue(lowerBound, upperBound) ;
    }

    return result ;
  }
330101
public void extendLowerBound(double[] bound) {
        if (bound.length != dimension) {
            throw new IllegalArgumentException(BOUND_SIZE_DON_T_MATCH_THE_DIMENSION);
        }

        boolean extend = false;
        for (int i = 0; i < bound.length; i++) {
            if (bound[i] < originalLowerBound[i]) {
                originalLowerBound[i] = bound[i];
                extend = true;
            }
        }

        if (extend) {
            reset();
        }
    }
878202
public static <K, V> Predicate<Map<K, V>> forValues(
      final Predicate<? super Collection<V>> p) {
    return new Predicate<Map<K, V>>() {
      @Override
      public boolean apply(Map<K, V> obj) {
        return p.apply(obj.values());
      }
    };
  }
542536
private static JSONObject parseBounds(Bounds bounds) throws JSONException {
        if (bounds != null) {
            JSONObject boundsObject = new JSONObject();
            JSONObject lowerRight = new JSONObject();
            JSONObject upperLeft = new JSONObject();

            lowerRight.put("x",
                           bounds.getLowerRight().getX().doubleValue());
            lowerRight.put("y",
                           bounds.getLowerRight().getY().doubleValue());

            upperLeft.put("x",
                          bounds.getUpperLeft().getX().doubleValue());
            upperLeft.put("y",
                          bounds.getUpperLeft().getY().doubleValue());

            boundsObject.put("lowerRight",
                             lowerRight);
            boundsObject.put("upperLeft",
                             upperLeft);

            return boundsObject;
        }

        return new JSONObject();
    }
370124
public static RangeImpl range(
            EvaluationContext ctx,
            Range.RangeBoundary lowBoundary,
            Object lowEndPoint,
            Object highEndPoint,
            Range.RangeBoundary highBoundary) {

        Comparable left = asComparable(lowEndPoint);
        Comparable right = asComparable(highEndPoint);
        if (left == null || right == null || !compatible(left, right)) {
            ctx.notifyEvt(() -> new ASTEventBase(
                    FEELEvent.Severity.ERROR,
                    Msg.createMessage(
                            Msg.INCOMPATIBLE_TYPE_FOR_RANGE,
                            left.getClass().getSimpleName()
                    ),
                    null));
            return null;
        }
        return new RangeImpl(
                lowBoundary,
                left,
                right,
                highBoundary);
    }
505370
public static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight) {
        return new Rectangle(upperLeft.getOrigin().x, upperLeft.getOrigin().y, lowerRight.getOrigin().x + upperLeft.tileSize, lowerRight.getOrigin().y + upperLeft.tileSize);
    }
1001682
public static FormValidation validateIntegerInRange(String value, int lower, int upper) {
        try {
            int intValue = Integer.parseInt(value);
            if (intValue < lower) {
                return error(hudson.model.Messages.Hudson_MustBeAtLeast(lower));
            }
            if (intValue > upper) {
                return error(hudson.model.Messages.Hudson_MustBeAtMost(upper));
            }
            return ok();
        } catch (NumberFormatException e) {
            return error(hudson.model.Messages.Hudson_NotANumber());
        }
    }
162225
public static <T> Predicate<T> negate(final Predicate<? super T> predicate) {
        return new Predicate<T>() {
            @Override
            public boolean test(final T testValue) {
                return !predicate.test(testValue);
            }
        };
    }
1086940
public TeradataQuery<T> qualify(Predicate predicate) {
        predicate = ExpressionUtils.predicate(SQLOps.QUALIFY, predicate);
        return queryMixin.addFlag(new QueryFlag(QueryFlag.Position.BEFORE_ORDER, predicate));
    }
174139
private static boolean canBeNewCurrInterval(Bound<?> lastBound, Bound<?> currentBound) {
        int vCompare = BoundValueComparator.compareValueDispatchingToInf(lastBound, currentBound);
        if (vCompare != 0) {
            return true;
        } else {
            if (lastBound.isLowerBound() && currentBound.isUpperBound()) {
                return true;
            } else if (lastBound.isUpperBound() && lastBound.getBoundaryType() == RangeBoundary.OPEN 
                && currentBound.isLowerBound() && currentBound.getBoundaryType() == RangeBoundary.OPEN) {
                return true; // the case x) (x
            } else {
                return false;
            }
        }
    }
25266
public DateRangeParam setUpperBoundExclusive(Date theUpperBound) {
		validateAndSet(myLowerBound, new DateParam(ParamPrefixEnum.LESSTHAN, theUpperBound));
		return this;
	}
1140642
public Range sumBoundaries(final Range plus) {
		int newMin = min + plus.min;
		int newMax = max == RANGE_MAX || plus.max == RANGE_MAX ? RANGE_MAX : max + plus.max;
		return new Range(newMin, newMax);
	}
748608
public static <T> BooleanSupplier curry(Predicate<T> predicate, T value) {
        dbc.precondition(predicate != null, "cannot bind parameter of a null predicate");
        return () -> predicate.test(value);
    }
420323
private int lowerBound(JoinFilterFunction searchFunction, int[] links, int first, int last, int probePosition, Page allProbeChannelsPage)
    {
        int middle;
        int step;
        int count = last - first;
        while (count > 0) {
            step = count / 2;
            middle = first + step;
            if (!applySearchFunction(searchFunction, links, middle, probePosition, allProbeChannelsPage)) {
                first = ++middle;
                count -= step + 1;
            }
            else {
                count = step;
            }
        }
        return first;
    }
1146186
@SuppressWarnings({ "unchecked", "rawtypes" })
    private Predicate preparePredicate(ConditionalCriteria criteria) {

        CriteriaBuilder builder = getCriteriaBuilder();
        Root<T> root = getRoot();
        Path<?> path = getPath(root, criteria.getPropertyFullName());

        ConditionalCriteria.Operator operator = criteria.getOperator();
        if (Operator.Equal.equals(operator)) {
            return builder.equal(path, criteria.getFirstOperant());
        } else if (Operator.IgnoreCaseEqual.equals(operator)) {
            return builder.equal(builder.upper(path.as(String.class)), ((String) criteria.getFirstOperant()).toUpperCase());
        } else if (Operator.LessThan.equals(operator)) {
            return builder.lessThan((Expression<Comparable>) path, (Comparable) criteria.getFirstOperant());
        } else if (Operator.LessThanOrEqual.equals(operator)) {
            return builder.lessThanOrEqualTo((Expression<Comparable>) path, (Comparable) criteria.getFirstOperant());
        } else if (Operator.GreatThan.equals(operator)) {
            return builder.greaterThan((Expression<Comparable>) path, (Comparable) criteria.getFirstOperant());
        } else if (Operator.GreatThanOrEqual.equals(operator)) {
            return builder.greaterThanOrEqualTo((Expression<Comparable>) path, (Comparable) criteria.getFirstOperant());
        } else if (Operator.Like.equals(operator)) {
            return builder.like((Expression<String>) path, (String) criteria.getFirstOperant());
        } else if (Operator.IgnoreCaseLike.equals(operator)) {
            return builder.like(builder.upper(path.as(String.class)), ((String) criteria.getFirstOperant()).toUpperCase());
        } else if (Operator.IsNull.equals(operator)) {
            return builder.isNull(path);
        } else if (Operator.IsNotNull.equals(operator)) {
            return builder.isNotNull(path);
        } else if (Operator.IsEmpty.equals(operator)) {
            // TODO: support additional types like Map,...
            if (getAttribute(root.getModel(), criteria.getPropertyFullName()).isCollection()) {
                return builder.isEmpty((Expression<Collection>)path);
            } else {
                return null;
            }
        } else if (Operator.IsNotEmpty.equals(operator)) {
            // TODO: support additional types like Map,...
            if (getAttribute(root.getModel(), criteria.getPropertyFullName()).isCollection()) {
                return builder.isNotEmpty((Expression<Collection>)path);
            } else {
                return null;
            }
        } else if (Operator.Between.equals(operator)) {
            return builder.between((Expression<Comparable>) path, (Comparable) criteria.getFirstOperant(), (Comparable) criteria.getSecondOperant());
        } else if (Operator.Not.equals(operator)) {
            return builder.not(preparePredicate((ConditionalCriteria) criteria.getFirstOperant()));
        } else if (Operator.Or.equals(operator) && criteria.getFirstOperant() instanceof List<?>) {
        	Predicate disjunction = builder.disjunction();
            List<ConditionalCriteria> list = (List<ConditionalCriteria>) criteria.getFirstOperant();
            for (ConditionalCriteria condition : list) {
                disjunction = builder.or(disjunction, preparePredicate(condition));
            }
            return disjunction;
        } else if (Operator.Or.equals(operator)) {
            return builder.or(
                    preparePredicate((ConditionalCriteria) criteria.getFirstOperant()),
                    preparePredicate((ConditionalCriteria) criteria.getSecondOperant()));
        } else if (Operator.And.equals(operator) && criteria.getFirstOperant() instanceof List<?>) {
            Predicate conjunction = builder.conjunction();
            List<ConditionalCriteria> list = (List<ConditionalCriteria>) criteria.getFirstOperant();
            for (ConditionalCriteria condition : list) {
                conjunction = builder.and(conjunction, preparePredicate(condition));
            }
            return conjunction;
        } else if (Operator.And.equals(operator)) {
            return builder.and(
                    preparePredicate((ConditionalCriteria) criteria.getFirstOperant()),
                    preparePredicate((ConditionalCriteria) criteria.getSecondOperant()));
        } else if (Operator.In.equals(operator)) {
            if (criteria.getFirstOperant() instanceof Collection<?>) {
                return path.in((Collection<?>) criteria.getFirstOperant());
            } else {
                return path.in((Object[])criteria.getFirstOperant());
            }
        } else if (Operator.EqualProperty.equals(operator)) {
            return builder.equal(path, getPath(root, (String) criteria.getFirstOperant()));
        } else if (Operator.LessThanProperty.equals(operator)) {
            return builder.lessThan((Expression<Comparable>) path, (Expression<Comparable>) getPath(root, (String) criteria.getFirstOperant()));
        } else if (Operator.LessThanOrEqualProperty.equals(operator)) {
            return builder.lessThanOrEqualTo((Expression<Comparable>) path, (Expression<Comparable>) getPath(root, (String) criteria.getFirstOperant()));
        } else if (Operator.GreatThanProperty.equals(operator)) {
            return builder.greaterThan((Expression<Comparable>) path, (Expression<Comparable>) getPath(root, (String) criteria.getFirstOperant()));
        } else if (Operator.GreatThanOrEqualProperty.equals(operator)) {
            return builder.greaterThanOrEqualTo((Expression<Comparable>) path, (Expression<Comparable>) getPath(getRoot(), (String) criteria.getFirstOperant()));
        } else if (Operator.ProjectionRoot.equals(operator)) {
            // TODO: support projectionRoot, if possible
            if (getConfig().throwExceptionOnConfigurationError()) {
                throw new QueryConfigException("Operator 'ProjectionRoot' is not supported");
            }
            return null;
        } else if (Operator.DistinctRoot.equals(operator)) {
            getConfig().setDistinct(true);
            return null;
        } else {
            return null;
        }
    }