StreamSummary implements ITopK<T> { public StreamSummary() { } StreamSummary();  StreamSummary(int capacity); int getCapacity(); @Override boolean add(T item); @Override boolean add(T element, long incrementCount); T offerReturnDropped(T item, int incrementCount); Pair<Boolean, T> offerReturnAll(T item, long incrementCount); @Override List<CountEntry<T>> peek(int k); List<Counter<T>> topK(int k); long size(); @Override String toString();  }
@Test public void testStreamSummary() { StreamSummary<String> vs = new StreamSummary<String>(3); String[] stream = {"X", "X", "Y", "Z", "A", "B", "C", "X", "X", "A", "A", "A"}; for (String i : stream) { vs.add(i); System.out.println(vs); } }