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 testStandardTypesPerKeyForInteger() {

    List<KV<Integer, Integer>> ints = new ArrayList<>();

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

    PCollection<KV<Integer, Long>> result =
        p.apply("Int", Create.of(ints)).apply("IntHLL", 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();
  }