src/main/java/com/github/fge/grappa/misc/RangeMatcherBuilder.java
public Rule max(final int nrCycles)
    {
        Preconditions.checkArgument(nrCycles >= 0,
            "illegal repetition number specified (" + nrCycles
                + "), must be 0 or greater");
        return range(Range.atMost(nrCycles));
    }
public Rule max(final int nrCycles)
    {
        Preconditions.checkArgument(nrCycles >= 0,
            "illegal repetition number specified (" + nrCycles
                + "), must be 0 or greater");
        return range(Range.atMost(nrCycles));
    }
public Rule max ( final int nrCycles ) { Preconditions . checkArgument ( nrCycles >= 0 , "illegal repetition number specified (" + nrCycles + "), must be 0 or greater" ) ; return range ( Range . atMost ( nrCycles ) ) ; }
Return a rule with a maximum number of cycles to run

@param nrCycles the number of cycles
@return a rule
@throws IllegalArgumentException {@code nrCycles} is less than 0

@see Range#atMost(Comparable)
Return a rule with a maximum number of cycles to run