title: A better way to test the value of an Option?
body: <p>I often find myself with an <code>Option[T]</code> for some type <code>T</code> and wish to test the value of the option against some value. For example:</p>
  
  <pre><code>val opt = Some("oxbow")
  if (opt.isDefined &amp;&amp; opt.get == "lakes") 
     //do something
  </code></pre>
  
  <p>The following code is equivalent and removes the requirement to test the <em>existence</em> of the value of the option</p>
  
  <pre><code>if (opt.map(_ == "lakes").getOrElse(false))
   //do something
  </code></pre>
  
  <p>However this seems less readable to me. Other possibilities are:</p>
  
  <pre><code>if (opt.filter(_ == "lakes").isDefined)
  
  if (opt.find(_ == "lakes").isDefined) //uses implicit conversion to Iterable
  </code></pre>
  
  <p>But I don't think these clearly express the intent either which would be better as:</p>
  
  <pre><code>if (opt.isDefinedAnd(_ == "lakes"))
  </code></pre>
  
  <p>Has anyone got a better way of doing this test?</p>