I'm using:
import scala.collection.JavaConverters._
import scala.collection.Set
This works:
val a: java.util.HashSet[java.lang.Long] = javaFunction(...)
val b: Set[java.lang.Long] = a.asScala.toSet
but what I want is a Set[Long], not a Set[java.lang.Long]. When I try this:
val a: java.util.HashSet[java.lang.Long] = javaFunction(...)
val b: Set[Long] = a.asScala.toSet
I get: Expression of type scala.collection.immutable.Set[java.lang.Long] doesn't conform to expected type scala.collection.Set[Long].
Why is this and how do I get a Set[Long]?