Provide an implementation for the following static method mod that computes the modulo function using "clock arithmetic".
/**
 * Computes {@code a} mod {@code b} as % should have been defined to work.
 * 
 * @param a
 *            the number being reduced
 * @param b
 *            the modulus
 * @return the result of a mod b, which satisfies 0 <= {@code mod} < b
 * @requires b > 0
 * @ensures <pre>
 * 0 <= mod  and  mod < b  and
 * there exists k: integer (a = k * b + mod)
 * </pre>
 */
public static int mod(int a, int b) {...}
Note that, although you can use the remainder operator % in your solution, the following is not a correct implementation.
public static int mod(int a, int b) {
    return a % b;
}