title: Cannot resolve symbol asJava : Intellij idea
body: <p>I've been doing scala coding on intellij idea. All was well until I added this piece of code (copied from <a href="https://stackoverflow.com/a/32380463/444644">https://stackoverflow.com/a/32380463/444644</a> ) : </p>
  
  <pre><code>  def toJava(x: Any): Any = {
      import scala.collection.JavaConverters._
      x match {
        case y: scala.collection.MapLike[_, _, _] =&gt;
          y.map { case (d, v) =&gt; toJava(d) -&gt; toJava(v) } asJava
        case y: scala.collection.SetLike[_,_] =&gt;
          y map { item: Any =&gt; toJava(item) } asJava
        case y: Iterable[_] =&gt;
          y.map { item: Any =&gt; toJava(item) } asJava
        case y: Iterator[_] =&gt;
          toJava(y.toIterable)
        case _ =&gt;
          x
      }
    }
  </code></pre>
  
  <p>This results in two "error" highlights for the first two asJava calls above. But the code compiles and runs fine. How to fix it?</p>
  
  <p><img src="https://i.imgur.com/OHPmxJj.png" alt="Screenshot"></p>