title: Convert IntStream to Map
body: <p>I have an <code>IntStream</code> and want for each element of that stream to do some calculations and return them as <code>Map</code> where keys are int values and values are result of that computations. I wrote following piece of code:</p>
  <pre class="lang-java prettyprint-override"><code>IntStream.range(0,10)
      .collect(
          Collectors.toMap(Function.identity(), i -&gt; computeSmth(i)));
  </code></pre>
  <p>where <code>computeSmth(Integer a)</code>. I got next compiler error</p>
  <pre class="lang-none prettyprint-override"><code>method collect in interface java.util.stream.IntStream cannot be applied to given types;
   required: java.util.function.Supplier&lt;R&gt;,java.util.function.ObjIntConsumer&lt;R&gt;,java.util.function.BiConsumer&lt;R,R&gt;
   found: java.util.stream.Collector&lt;java.lang.Object,capture#1 of ?,java.util.Map&lt;java.lang.Object,java.lang.String&gt;&gt;
   reason: cannot infer type-variable(s) R
     (actual and formal argument lists differ in length)
  </code></pre>
  <p>What I'm doing wrong?</p>