/** * Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an * array. * * <p>This method may be used whenever an array range check is needed. * * @param a an array. * @param from a start index (inclusive). * @param to an end index (inclusive). * @throws IllegalArgumentException if <code>from</code> is greater than <code>to</code>. * @throws ArrayIndexOutOfBoundsException if <code>from</code> or <code>to</code> are greater than * the array length or negative. */ public static void ensureFromTo(final long[] a, final int from, final int to) { Arrays.ensureFromTo(a.length, from, to); }