title: How to cast java.lang.Object to a specific type in Scala?
body: <p>As far as I know, in Java I can</p>
  
  <pre><code>Object o = new String("abc")
  String s = (String) o
  </code></pre>
  
  <p>But how to rewrite it in Scala?</p>
  
  <pre><code>val o: java.lang.Object = new java.lang.String("abc")
  val s: String = // ??
  </code></pre>
  
  <p>A Java library I want to use returns <code>java.lang.Object</code> which I need to cast to a more specific type (also defined in this library). A Java example does it exactly the way like the first example of mine, but just using Scala's <code>source: TargetType</code> instead of Java's <code>(TargetType)source</code> doesn't work.</p>