title: How can I display count of duplicates in arraylist
body: <p>Consider below arraylist that consists of duplicates. How would I filtering out  integer 89 that occurred 4 times e.g 89:4 .  Expecting output 89 : 4</p>
  
  <pre><code>List&lt;Integer&gt; list = Arrays.asList(1, 1, 2, 3, 5, 8, 13, 21, 21, 61, 98, 15, 25, 41, 67,55, 89, 89, 89, 89 );         
  Map&lt;Integer ,Long &gt; map = list.stream()
          .collect(Collectors.groupingBy(c -&gt;c , Collectors.counting())) ;
  map.forEach(   (k , v ) -&gt; System.out.println( k + " : "+ v ));
  </code></pre>
  
  <p>//I am  Expecting  output below 
  <strong>89 : 4</strong></p>
  
  <p>// Actual output (key, Values)pairs of above code snippet like below 
  1 : 2
  98 : 1
  2 : 1
  67 : 1
  3 : 1
  5 : 1
  8 : 1
  41 : 1
  13 : 1
  15 : 1
  21 : 2
  55 : 1
  89 : 4
  25 : 1
  61 : 1</p>