public static <InputT> GloballyDistinct<InputT> globally() {
    return GloballyDistinct.<InputT>builder().build();
  }
@Test
  public void bigCardinality() {
    final int cardinality = 15000;
    final int p = 15;
    final int sp = 20;
    final double expectedErr = 1.04 / Math.sqrt(p);

    List<Integer> stream = new ArrayList<>();
    for (int i = 1; i <= cardinality; i++) {
      stream.addAll(Collections.nCopies(2, i));
    }
    Collections.shuffle(stream);

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

    PAssert.that("Verify Accuracy for big cardinality", res)
        .satisfies(new VerifyAccuracy(cardinality, expectedErr));

    tp.run();
  }