Scala, doesn't like java collections API?
===

I'm using asynchttpclient. When building up parameters, one passes a java.util.Map to the setParameters method.

The (Java) signature looks like the following:

    setParameters(Map<String,Collection<String>);

Real day 1 stuff. But wow, I'm trying to call it from Scala and I cannot for the life of me create a collection to match that signature. 

Here's the mess I've created so far.

    var m:java.util.Map[java.lang.String,java.util.Collection[java.lang.String]] = new java.util.HashMap[java.lang.String,java.util.HashSet[java.lang.String]]()
    val req = new RequestBuilder().setUrl("http://localhost:1234/").setParameters(m).build


And here's the error message, 

>     Multiple markers at this line
	- type mismatch; found : java.util.HashMap[java.lang.String,java.util.HashSet[java.lang.String]] required: 
	 java.util.Map[java.lang.String,java.util.Collection[java.lang.String]] Note: java.util.HashSet[java.lang.String] <: java.util.Collection[java.lang.String], but Java-defined 
	 **trait Map is invariant in type V. You may wish to investigate a wildcard type such as `_ <: java.util.Collection[java.lang.String]`. (SLS 3.2.10)**
	- type mismatch; found : 

Fair enough, I wouldn't have thought I was doing something particularly complicated, but lets give the compiler suggestion a try...

So I change it to the following 

     var m:java.util.Map[java.lang.String,_ <: java.util.Collection[java.lang.String]] = new java.util.HashMap[java.lang.String,java.util.HashSet[java.lang.String]]()
     val req = new RequestBuilder().setUrl("http://localhost:1234/").setParameters(m).build
      

And receive the following lovely error message in response.

>     Multiple markers at this line
    	- overloaded method value setParameters with alternatives: (com.ning.http.client.FluentStringsMap)com.ning.http.client.RequestBuilder <and> 
    	 (java.util.Map[java.lang.String,java.util.Collection[java.lang.String]])com.ning.http.client.RequestBuilder cannot be applied to (java.util.Map[java.lang.String,_$1])

I've spent the morning writing Python, have I just wasted 2 years of my life?

