@Test
public void testExtendedScan() {

  byte[] row1 = Bytes.toBytes("row1");
  byte[] row2 = Bytes.toBytes("row2");
  byte[] startRow = Bytes.toBytes(START_KEY);
  byte[] stopRow = Bytes.toBytes(STOP_KEY);
  byte[] prefix = Bytes.toBytes("prefix");
  byte[] prefixEnd = calculatePrefixEnd(prefix);
  BigtableExtendedScan scan = new BigtableExtendedScan();
  scan.addRowKey(row1);
  scan.addRowKey(row2);
  scan.addRange(startRow, stopRow);
  scan.addRangeWithPrefix(prefix);
  scanAdapter.adapt(scan, throwingReadHooks, query);
  RowSet expected =
      RowSet.newBuilder()
          .addRowKeys(ByteStringer.wrap(row1))
          .addRowKeys(ByteStringer.wrap(row2))
          .addRowRanges(toRange(prefix, prefixEnd))
          .addRowRanges(toRange(startRow, stopRow))
          .build();
  Assert.assertEquals(expected, query.toProto(requestContext).getRows());
}