package com.tyleryates.util;

import java.util.Random;

/**
 * Utility class that provides various helper methods for dealing with integers.
 */
public final class Integers {

    /**
     * Returns whether the given number is positive i.e. {@code n > 0}.
     *
     * @param n the given number
     *
     * @return whether the given number is positive
     */
    public static boolean isPositive(int n) {
        return n > 0;
    }

    /**
     * Returns whether the given number is negative i.e. {@code n < 0}.
     *
     * @param n the given number
     *
     * @return whether the given number is negative
     */
    public static boolean isNegative(int n) {
        return n < 0;
    }

    /**
     * Returns whether the given number is non-negative i.e. {@code n >= 0}.
     *
     * @param n the given number
     *
     * @return whether the given number is non-negative
     */
    public static boolean isNonNegative(int n) {
        return n >= 0;
    }

    /**
     * Returns whether the given number is non-positive i.e. {@code n <= 0}.
     *
     * @param n the given number
     *
     * @return whether the given number is non-positive
     */
    public static boolean isNonPositive(int n) {
        return n <= 0;
    }

    /**
     * Returns whether the given number is even.
     *
     * @param n the given number
     *
     * @return whether the given number is even
     */
    public static boolean isEven(int n) {
        return n % 2 == 0;
    }

    /**
     * Returns whether the given number is odd.
     *
     * @param n the given number
     *
     * @return whether the given number is odd
     */
    public static boolean isOdd(int n) {
        return n % 2 != 0;
    }

    /**
     * Returns a random integer within the given range {@code [lowerBound, upperBound]}.
     *
     * @param lowerBound the lower bound of the given range (inclusive)
     * @param upperBound the upper bound of the given range (inclusive)
     *
     * @return a random integer withing the given range
     */
    public static int randomInt(int lowerBound, int upperBound) {
        return new Random().nextInt(upperBound + 1 - lowerBound) + lowerBound;
    }
}

@@ -49,16 +49,83 @@
 andom;%0A%0A
+import static com.google.common.base.Preconditions.checkArgument;%0A%0A
 /**%0A * U
@@ -2100,103 +2100,976 @@
    *
-/%0A    public static int randomInt(int lowerBound, int upperBound) %7B%0A        return new Random()
+%0A     * @throws IllegalArgumentException if %7B@code lowerBound%7D %3E= %7B@code upperBound%7D.%0A     */%0A    public static int randomInt(int lowerBound, int upperBound) %7B%0A        return randomInt(lowerBound, upperBound, new Random());%0A    %7D%0A%0A    /**%0A     * Returns a random integer within the given range %7B@code %5BlowerBound, upperBound%5D%7D using the given %7B@link Random%7D%0A     * instance.%0A     *%0A     * @param lowerBound the lower bound of the given range (inclusive)%0A     * @param upperBound the upper bound of the given range (inclusive)%0A     * @param random the given %7B@link Random%7D instance%0A     *%0A     * @return a random integer withing the given range%0A     *%0A     * @throws IllegalArgumentException if %7B@code lowerBound%7D %3E= %7B@code upperBound%7D or %7B@code random%7D is %7B@code null%7D.%0A     */%0A    public static int randomInt(int lowerBound, int upperBound, Random random) %7B%0A        checkArgument(lowerBound %3C upperBound);%0A        checkArgument(random != null);%0A%0A        return random
 .nex

Add overloaded randomInt method that takes in a Random instance. Make randomInt methods throw IllegalArgumentException if bounds are incorrect.