@VisibleForTesting
  Range<RowKeyWrapper> boundedRange(BoundType startBound, ByteString startKey, BoundType endBound,
      ByteString endKey) {
    // Bigtable doesn't allow empty row keys, so an empty start row which is open or closed is
    // considered unbounded. ie. all row keys are bigger than the empty key (no need to
    // differentiate between open/closed)
    final boolean startUnbounded = startKey.isEmpty();

    // Bigtable doesn't allow empty row keys, so an empty end row which is open or closed is
    // considered unbounded. ie. all row keys are smaller than the empty end key (no need to
    // differentiate between open/closed)
    final boolean endUnbounded = endKey.isEmpty();

    if (startUnbounded && endUnbounded) {
      return Range.all();
    } else if (startUnbounded) {
      return Range.upTo(new RowKeyWrapper(endKey), endBound);
    } else if (endUnbounded) {
      return Range.downTo(new RowKeyWrapper(startKey), startBound);
    } else {
      return Range.range(new RowKeyWrapper(startKey), startBound,
          new RowKeyWrapper(endKey), endBound);
    }
  }
@ VisibleForTesting Range < RowKeyWrapper > boundedRange ( BoundType startBound , ByteString startKey , BoundType endBound , ByteString endKey ) { final boolean startUnbounded = startKey . isEmpty ( ) ; final boolean endUnbounded = endKey . isEmpty ( ) ; if ( startUnbounded && endUnbounded ) { return Range . all ( ) ; } else if ( startUnbounded ) { return Range . upTo ( new RowKeyWrapper ( endKey ) , endBound ) ; } else if ( endUnbounded ) { return Range . downTo ( new RowKeyWrapper ( startKey ) , startBound ) ; } else { return Range . range ( new RowKeyWrapper ( startKey ) , startBound , new RowKeyWrapper ( endKey ) , endBound ) ; } }
To determine {@link Range<RowKeyWrapper>} based start/end key & {@link BoundType}.