title: How to handle different package names in different versions?
body: <p>I have a 3rd party library with package <code>foo.bar</code></p>
  
  <p>I normally use it as:</p>
  
  <pre><code>import foo.bar.{Baz =&gt; MyBaz}
  
  object MyObject {
    val x = MyBaz.getX // some method defined in Baz
  }
  </code></pre>
  
  <p>The new version of the library has renamed the package from <code>foo.bar</code> to <code>newfoo.newbar</code>. I have now another version of my code with the slight change as follows:</p>
  
  <pre><code>import newfoo.newbar.{Baz =&gt; MyBaz}
  
  object MyObject {
    val x = MyBaz.getX // some method defined in Baz
  }
  </code></pre>
  
  <p>Notice that only the first import is different. 
  Is there any way I can keep the same version of my code and still switch between different versions of the 3rd party library as and when needed?</p>
  
  <p>I need something like <a href="https://stackoverflow.com/q/26738884/243233">conditional imports</a>, or an alternative way.</p>