### Question:
GkQuantileEstimator implements QuantileEstimator<T> { @Override public void add(T value) { _quantileEstimationGK.insert(value); } GkQuantileEstimator(GkQuantileEstimatorConfig<T> config); @Override void add(T value); @Override Map<Double, T> get(List<Double> quantiles);  }### Answer:
@Test public void gkTest() { final int window_size = 10000; final double epsilon = 0.001; System.out.println("Generating random longs..."); List<Long> shuffle = new ArrayList<>(); for (long i = 0; i < window_size; i++) { shuffle.add(i); } Random rand = new Random(0xDEADBEEF); Collections.shuffle(shuffle, rand); System.out.println("Inserting into estimator..."); QuantileEstimationGK<Long> estimator = new QuantileEstimationGK<>(LongComparator.DEFAULT, epsilon, 1000); for (long l : shuffle) { estimator.insert(l); } double[] quantiles = { 0.5, 0.9, 0.95, 0.99, 1.0 }; for (double q : quantiles) { long estimate = estimator.query(q); long actual = (long) ((q) * (window_size - 1)); System.out.println(String.format("Estimated %.2f quantile as %d (actually %d)", q, estimate, actual)); } System.out.println("# of samples: " + estimator.samples.size()); }