code: public static VariantStreamIterator enforceShardBoundary(ManagedChannel channel,
        StreamVariantsRequest request, Requirement shardBoundary, String fields) {
      Predicate<Variant> shardPredicate;
      if(ShardBoundary.Requirement.STRICT == shardBoundary) {
        shardPredicate = ShardBoundary.getStrictVariantPredicate(request.getStart(), fields);
      } else {
        shardPredicate = null;
      }
  
      return new VariantStreamIterator(channel, request, shardPredicate);
    }
docs: Create a stream iterator that can enforce shard boundary semantics.
  
  @param channel The ManagedChannel.
  @param request The request for the shard of data.
  @param shardBoundary The shard boundary semantics to enforce.
  @param fields Used to check whether the specified fields would meet the minimum required
  fields for the shard boundary predicate, if applicable.