Equivalent of {@code allOf(greaterThan(min), lessThan(max))} matcher combination
@param min the minimum value of the range
@param max the maximum value of the range
@param <T> the matcher type
@return the matcher
546948
public static <T extends Comparable<T>> Matcher<T> between(T min, T max) {
        return allOf(greaterThan(min), lessThan(max));
    }
840385
static Matcher optimize(Matcher matcher) {
    Matcher m = matcher;
    Matcher opt = optimizeSinglePass(m);
    for (int i = 0; !m.equals(opt) && i < MAX_ITERATIONS; ++i) {
      m = opt;
      opt = optimizeSinglePass(m);
    }
    return opt;
  }
95616
@SuppressWarnings("unchecked")
	public static <T extends Comparable<? super T>> T min(T... numberArray) {
		return ArrayUtil.min(numberArray);
	}
201840
public static Pattern times(final int min, final int max, final CharPredicate predicate) {
    Checks.checkMinMax(min, max);
    return new Pattern() {
      @Override
      public int match(CharSequence src, int begin, int end) {
        int minLen = RepeatCharPredicatePattern.matchRepeat(min, predicate, src, end, begin, 0);
        if (minLen == MISMATCH)
          return MISMATCH;
        return matchSome(max - min, predicate, src, end, begin + minLen, minLen);
      }
    };
  }
403008
public void setMinMax(int min, int max)
    {
        if(min >= max)
            throw new IllegalArgumentException("The input minimum (" + min + ") must be less than the given max (" + max  + ")");
        this.min = min;
        this.max = max;
    }
546645
public static Predicate<MonetaryAmount> isBetween(MonetaryAmount min, MonetaryAmount max){
        return isLessThanOrEqualTo(max).and(isGreaterThanOrEqualTo(min));
    }
197790
@Override
    public <N extends Number> Expression<N> max(Expression<N> arg0)
    {
        // TODO Auto-generated method stub
        return null;
    }
588145
public static double random(double min, double max) {
        assert max > min;
        return min + Math.random() * (max - min);
    }
96646
public static long randomLong(final long min, final long max) {

        return Math.round(Math.random() * (max - min) + min);
    }
916002
public List<String> splitMatches(String text, int minSize) {
    TrieNode node = inner.root();
    List<String> matches = new ArrayList<>();
    String accumulator = "";
    for (int i = 0; i < text.length(); i++) {
      short prevDepth = node.getDepth();
      TrieNode prevNode = node;
      node = node.getContinuation(text.charAt(i));
      if (null == node) node = inner.root();
      if (!accumulator.isEmpty() && (node.getDepth() < prevDepth || (prevNode.hasChildren() && node.getDepth() == prevDepth))) {
        if (accumulator.length() > minSize) {
          matches.add(accumulator);
          node = ((Optional<TrieNode>) inner.root().getChild(text.charAt(i))).orElse(inner.root());
        }
        accumulator = "";
      }
      else if (!accumulator.isEmpty()) {
        accumulator += text.charAt(i);
      }
      else if (accumulator.isEmpty() && node.getDepth() > prevDepth) {
        accumulator = node.getString();
      }
    }
    List<String> tokenization = new ArrayList<>();
    for (String match : matches) {
      int index = text.indexOf(match);
      assert (index >= 0);
      if (index > 0) tokenization.add(text.substring(0, index));
      tokenization.add(text.substring(index, index + match.length()));
      text = text.substring(index + match.length());
    }
    tokenization.add(text);
    return tokenization;
  }
1035253
public static void minMax(Integer min, Integer max) {
		if(!validation) return;
		Validate.notNull(min);
		Validate.notNull(max);
		if(min > max)
			throw new ParameterException(ErrorCode.RANGEVIOLATION, "Minumum is bigger than maximum.");
	}
929153
public final Parser<Void> skipTimes(int min, int max) {
    Checks.checkMinMax(min, max);
    return new SkipTimesParser(this, min, max);
  }
1024293
public int getNumberBetween(final int min, final int max) {

    if (max < min) {
      throw new IllegalArgumentException(String.format("Minimum must be less than minimum (min=%d, max=%d)", min, max));
    }
    if (max == min) {
      return min;
    }

    return min + random.nextInt(max - min);
  }
654942
@SuppressWarnings("unchecked")
    public NumberExpression<T> min() {
        if (min == null) {
            min = Expressions.numberOperation(getType(), Ops.AggOps.MIN_AGG, mixin);
        }
        return min;
    }
372127
public static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final long seed) {
        return new BigDecimalRangeRandomizer(min, max, seed);
    }
405134
public static DoubleRangeRandomizer aNewDoubleRangeRandomizer(final Double min, final Double max, final long seed) {
        return new DoubleRangeRandomizer(min, max, seed);
    }
1223306
public int matches(Replaceable text,
                       int[] offset,
                       int limit,
                       boolean incremental) {
        int start = offset[0];
        int count = 0;
        while (count < maxCount) {
            int pos = offset[0];
            int m = matcher.matches(text, offset, limit, incremental);
            if (m == U_MATCH) {
                ++count;
                if (pos == offset[0]) {
                    // If offset has not moved we have a zero-width match.
                    // Don't keep matching it infinitely.
                    break;
                }
            } else if (incremental && m == U_PARTIAL_MATCH) {
                return U_PARTIAL_MATCH;
            } else {
                break;
            }
        }
        if (incremental && offset[0] == limit) {
            return U_PARTIAL_MATCH;
        }
        if (count >= minCount) {
            return U_MATCH;
        }
        offset[0] = start;
        return U_MISMATCH;
    }