code: public static <T> Set<T> filterShards(DimFilter dimFilter, Iterable<T> input, Function<T, ShardSpec> converter)
    {
      return filterShards(dimFilter, input, converter, new HashMap<String, Optional<RangeSet<String>>>());
    }
docs: Filter the given iterable of objects by removing any object whose ShardSpec, obtained from the converter function,
  does not fit in the RangeSet of the dimFilter {@link DimFilter#getDimensionRangeSet(String)}. The returned set
  contains the filtered objects in the same order as they appear in input.
  
  If you plan to call this multiple times with the same dimFilter, consider using
  {@link #filterShards(DimFilter, Iterable, Function, Map)} instead with a cached map
  
  @param dimFilter The filter to use
  @param input The iterable of objects to be filtered
  @param converter The function to convert T to ShardSpec that can be filtered by
  @param <T> This can be any type, as long as transform function is provided to convert this to ShardSpec
  @return The set of filtered object, in the same order as input