code: private void checkIndices(int row, int col) {
          if (row < 0 || col < 0 || row >= values.length || col >= values.length)
              throw new ArrayIndexOutOfBoundsException();
      }
docs: Checks that the given row and column values are non-negative, and less
  than the number of diagonals in this {@code DiagonalMatrix}.
  
  @param row The row index to check.
  @param col The col index to check.
  
  @throws IllegalArgumentException if either index is invalid.