code: public boolean containsLogEntry(long entryIndex) {
          long sequence = toSequence(entryIndex);
          return sequence >= logs.headSequence() && sequence <= logs.tailSequence();
      }
docs: Returns true if the log contains an entry at {@code entryIndex},
  false otherwise.
  <p>
  Important: Log entry indices start from 1, not 0.