title: kstreams grouping on two fields to get the count
body: <p>Can we groupby two fields(one is key and another value) and get the count in kstreams.</p>
  
  <p>I want to get distinct counts of userid(value) for each pid(key).groupByKey will not give the distinct userid's.
  I tried to use groupBy instead of groupByKey but seeing syntax errors. Can someone help?</p>
  
  <pre><code>   KStream&lt;Integer, Integer&gt; stream = events.map((key, value) -&gt; new KeyValue&lt;Integer, Integer&gt;(value.getpid(), value.getUserId()));
  
     KGroupedStream&lt;Integer, Integer&gt; groupedStream = stream.groupByKey(Grouped.with(Serdes.Integer(), Serdes.Integer());
  </code></pre>