title: Convert Scala Set into Java (java.util.Set)?
body: <p>I have a Set in Scala (I can choose any implementation as I am creating the Set. The Java library I am using is expecting a java.util.Set[String].</p>
  
  <p>Is the following the correct way to do this in Scala (using scala.collection.jcl.HashSet#underlying):</p>
  
  <pre><code>import com.javalibrary.Animals
  
  var classes = new scala.collection.jcl.HashSet[String]
  classes += "Amphibian"
  classes += "Reptile"
  Animals.find(classes.underlying)
  </code></pre>
  
  <p>It seems to be working, but since I am very new to Scala I want to know if this is the preferred way (any other way I try I am getting a type-mismatch error):</p>
  
  <pre><code>error: type mismatch;
   found   : scala.collection.jcl.HashSet[String]
   required: java.util.Set[_]
  </code></pre>