I would like to create a java List based on another java Collection eg. Set in Scala.
Why is this not possible? I get a required: scala.this.Int error.
val in: java.util.Set[String] = new java.util.HashSet()
val out : java.util.List[String] = new java.util.ArrayList(in)
This worked however, but doesn't feel right:
val in: java.util.Set[String] = new java.util.HashSet()
val out: List[String] = new java.util.ArrayList()
out.addAll(in.asInstanceOf[java.util.Set[String]])
Thanks!