I would like to be able to perform the following, but it fails in the call to useMap. How can I perform this conversion?
scala> import scala.collection.Ja
scala> v.asJava
:16: error: type mismatch;
found : java.util.Map[Int,scala.Float]
required: java.util.Map[Integer,java.lang.Float]
The type of v is Map[scala.Int, scala.Float], not Map[java.lang.Integer, java.lang.Float].
You could try this:
import java.lang.{Float => JFloat}
useMap(v.map{ case (k, v) => (k: Integer) -> (v: JFloat)})