title: How to suppress deprecation warnings when testing deprecated Scala functions?
body: <p>Suppose I have a library, which contains both a deprecated function and a preferred function:</p>
  
  <pre><code>object MyLib {
    def preferredFunction() = ()
    @deprecated("Use preferredFunction instead", "1.0") def deprecatedFunction() = ()
  }
  </code></pre>
  
  <p>I want to test both <code>preferredFunction</code> and <code>deprecatedFunction</code> in ScalaTest:</p>
  
  <pre><code>class MyLibSpec extends FreeSpec with Matchers {
    "preferred function" in {
      MyLib.preferredFunction() should be(())
    }
    "deprecated function" in {
      MyLib.deprecatedFunction() should be(())
    }
  }
  </code></pre>
  
  <p>However, a deprecation warning is reported at <code>MyLib.deprecatedFunction()</code>.</p>
  
  <p>How to avoid the warning?</p>