I have a Java API that returns a List like:
public List> getByXPath(String xpathExpr)
I am using the below scala code:
JavaConverters
instead. (comment by @Yaroslav)Since Scala 2.8 this conversion is now built into the language using:
import scala.collection.JavaConversions._
...
lst.toList.foreach{ node => .... }
works. asScala
did not work
In 2.12.x use import scala.collection.JavaConverters._
In 2.13.x use import scala.jdk.CollectionConverters._