public static <K, V> PerKey<K, V> perKey() {
    return new AutoValue_ApproximateCountDistinct_PerKey.Builder<K, V>()
        .setPrecision(HllCount.DEFAULT_PRECISION)
        .build();
  }
@Test
  @Category(NeedsRunner.class)
  public void testStandardTypesPerKeyForStrings() {
    List<KV<Integer, String>> strings = new ArrayList<>();

    for (int i = 0; i < 3; i++) {
      for (int k : INTS1) {
        strings.add(KV.of(i, String.valueOf(k)));
      }
    }

    PCollection<KV<Integer, Long>> result =
        p.apply("Str", Create.of(strings)).apply("StrHLL", ApproximateCountDistinct.perKey());

    PAssert.that(result)
        .containsInAnyOrder(
            ImmutableList.of(
                KV.of(0, INTS1_ESTIMATE), KV.of(1, INTS1_ESTIMATE), KV.of(2, INTS1_ESTIMATE)));

    p.run();
  }