I have a Java API that returns a List like:
public List<?> getByXPath(String xpathExpr)
I am using the below scala code:
val lst = node.getByXPath(xpath)
Now if I try scala syntax sugar like:
lst.foreach{ node => ... }
it does not work. I get the error:
value foreach is not a member of java.util.List[?0]
It seems I need to convert Java List to Scala List. How to do that in above context?