@Override
  public StoreFileReader getReader() {
    final long len = this.length;
    final TimeRangeTracker timeRangeTracker = this.timeRangeTracker;
    final long entries = this.entryCount;
    return new StoreFileReader() {
      @Override
      public long length() {
        return len;
      }

      @Override
      public long getMaxTimestamp() {
        return timeRange == null ? Long.MAX_VALUE : timeRangeTracker.getMax();
      }

      @Override
      public long getEntries() {
        return entries;
      }

      @Override
      public void close(boolean evictOnClose) throws IOException {
        // no-op
      }

      @Override
      public Optional<ExtendedCell> getLastKey() {
        if (splitPoint != null) {
          return Optional
            .of(ExtendedCellBuilderFactory.create(CellBuilderType.DEEP_COPY).setType(Cell.Type.Put)
              .setRow(Arrays.copyOf(splitPoint, splitPoint.length + 1)).build());
        } else {
          return Optional.empty();
        }
      }

      @Override
      public Optional<ExtendedCell> midKey() throws IOException {
        if (splitPoint != null) {
          return Optional.of(ExtendedCellBuilderFactory.create(CellBuilderType.DEEP_COPY)
            .setType(Cell.Type.Put).setRow(splitPoint).build());
        } else {
          return Optional.empty();
        }
      }

      @Override
      public Optional<ExtendedCell> getFirstKey() {
        if (splitPoint != null) {
          return Optional.of(ExtendedCellBuilderFactory.create(CellBuilderType.DEEP_COPY)
            .setType(Cell.Type.Put).setRow(splitPoint, 0, splitPoint.length - 1).build());
        } else {
          return Optional.empty();
        }
      }
    };
  }
A mock used so our tests don't deal with actual StoreFiles
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java