code: private boolean validIndex(long index) {
      long firstIndex = firstIndex();
      long lastIndex = lastIndex();
      return !isEmpty() && firstIndex <= index && index <= lastIndex;
    }
docs: Returns a boolean value indicating whether the given index is within the bounds of the log.
  <p>
  If the index is less than {@code 1} or greater than {@link Log#lastIndex()} then this method will return
  {@code false}, otherwise {@code true}.
  
  @param index The index to check.
  @return Indicates whether the given index is within the bounds of the log.
  @throws IllegalStateException If the log is not open.