public static Predicate<Variant> getStrictVariantPredicate(final long start, String fields) {
    Preconditions
    .checkArgument(Strings.isNullOrEmpty(fields)
        || VARIANT_FIELD_PATTERN.matcher(fields).matches(),
        "Insufficient fields requested in partial response. At a minimum "
            + "include 'variants(start)' to enforce a strict shard boundary.");
    return new Predicate<Variant>() {
      @Override
      public boolean apply(Variant variant) {
        return variant.getStart() >= start;
      }
    };
  }
public static Predicate < Variant > getStrictVariantPredicate ( final long start , String fields ) { Preconditions . checkArgument ( Strings . isNullOrEmpty ( fields ) || VARIANT_FIELD_PATTERN . matcher ( fields ) . matches ( ) , "Insufficient fields requested in partial response. At a minimum " + "include 'variants(start)' to enforce a strict shard boundary." ) ; return new Predicate < Variant > ( ) { @ Override public boolean apply ( Variant variant ) { return variant . getStart ( ) >= start ; } } ; }
Predicate expressing the logic for which variants should and should not be included in the shard.

@param start The start position of the shard.
@return Whether the variant would be included in a strict shard boundary.