I am trying to convert a map from scala to java:
private def toJava(map: Map[Int, Set[Int]]): util.Map[Integer, util.Set[Integer]] = {
scala.collection.JavaConverters.mapAsJavaMapConverter(
map.mapValues(scala.collection.JavaConverters.setAsJavaSetConverter(_).asJava)).asJava
}
However, the Int
is not converted to Integer
, And I don't find the way to achieve that.
What is the scala way to do it?