ConcurrentStreamSummary implements ITopK<T> { @Override public boolean add(final T element) { return add(element, 1); } ConcurrentStreamSummary(final int capacity); @Override boolean add(final T element); @Override boolean add(final T element, final long incrementCount); @Override String toString(); @Override List<CountEntry<T>> peek(final int k); long size(); List<ScoredItem<T>> peekWithScores(final int k);  }
@Test public void testStreamSummary() { ConcurrentStreamSummary<String> vs = new ConcurrentStreamSummary<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); } }