title: Replacing if-else within 'for' loops with Java-8 Streams
body: <p>I have following simple code that I am trying to convert to functional style</p>
  
  <pre><code>for(String str: list){
      if(someCondition(str)){
         list2.add(doSomeThing(str));
      }
      else{
          list2.add(doSomethingElse(str));
      }
  }
  </code></pre>
  
  <p>Is it easily possible to replace this loop with stream? Only option I see is to iterate over the stream twice with two different filter conditions.</p>