code: public static void validArraySlice(final int sliceFrom,
              final int sliceLength, final int arrayLength, final String message) {
          if (sliceFrom < 0 || sliceLength < 0) {
              throw new IndexOutOfBoundsException(message);
          }
          if (sliceFrom + sliceLength > arrayLength) {
              throw new IndexOutOfBoundsException(message);
          }
      }
docs: Throws an {@link IndexOutOfBoundsException} if {@code sliceFrom} or
  {@code sliceLength} is negative or the sum of both is greater than
  {@code arrayLength}. Note that this means that a slice of length zero
  starting at array length is a valid slice.
  
  
  @param sliceFrom the start index of the slice to be checked
  @param sliceLength the length of the slice to be checked
  @param arrayLength the upper bound against which the slice is checked
  @param message exception message