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