title: Instream and Stream
body: <p>Whats the difference between the two? Are they the same thing ?</p>
  
  <p>In Stream API </p>
  
  <p><strong>Filter</strong></p>
  
  <p><code>Stream&lt;T&gt; filter(Predicate&lt;? super T&gt; predicate)</code></p>
  
  <p>Returns a stream consisting of the elements of this stream that match the given predicate.</p>
  
  <p>This is an intermediate operation.</p>
  
  <p><strong>mapToInt</strong></p>
  
  <p><code>IntStream mapToInt(ToIntFunction&lt;? super T&gt; mapper)</code></p>
  
  <p>Returns an <code>IntStream</code> consisting of the results of applying the given function to the elements of this stream.</p>
  
  <p>This is an intermediate operation.</p>
  
  <p><code>Filter</code> returns a <code>stream</code> and <code>mapToInt</code> returns an <code>IntStream</code>. </p>