title: Scala: add items to a sequence or merge sequences conditionally
body: <p>I need to add an item to a <code>Seq</code> depending on a condition.</p>
  
  <p>The only thing I have been able to do is:</p>
  
  <pre><code>if(condition){
      part1 ++ part2 ++ Seq(newItem)
  }
  else {
    part1 ++ part2
  }
  </code></pre>
  
  <p><code>part1</code> and <code>part2</code> are <code>Seq[String]</code>.
  It works but there is a lot of repeated code. Any way to do this better?
  Thank you</p>