code: public static <T> T[] validIndex(final T[] array, final int index, final String message, final Object... values) {
          Validate.notNull(array);
          if (index < 0 || index >= array.length) {
              throw new IndexOutOfBoundsException(StringUtils.simpleFormat(message, values));
          }
          return array;
      }
docs: <p>Validates that the index is within the bounds of the argument
  array; otherwise throwing an exception with the specified message.</p>
  
  <pre>Validate.validIndex(myArray, 2, "The array index is invalid: ");</pre>
  
  <p>If the array is {@code null}, then the message of the exception
  is &quot;The validated object is null&quot;.</p>
  
  @param <T> the array type
  @param array  the array to check, validated not null by this method
  @param index  the index to check
  @param message  the {@link String#format(String, Object...)} exception message if invalid, not null
  @param values  the optional values for the formatted exception message, null array not recommended
  @return the validated array (never {@code null} for method chaining)
  @throws NullPointerException if the array is {@code null}
  @throws IndexOutOfBoundsException if the index is invalid
  @see #validIndex(Object[], int)
  
  @since 3.0