public static <InputT> GloballyDistinct<InputT> globally() {
    return GloballyDistinct.<InputT>builder().build();
  }
@Test
  public void smallCardinality() {
    final int smallCard = 1000;
    final int p = 6;
    final double expectedErr = 1.104 / Math.sqrt(p);

    List<Integer> small = new ArrayList<>();
    for (int i = 0; i < smallCard; i++) {
      small.add(i);
    }

    PCollection<Long> cardinality =
        tp.apply("small stream", Create.of(small))
            .apply("small cardinality", ApproximateDistinct.<Integer>globally().withPrecision(p));

    PAssert.that("Not Accurate Enough", cardinality)
        .satisfies(new VerifyAccuracy(smallCard, expectedErr));

    tp.run();
  }