I have a Java API that returns a List like:
public List> getByXPath(String xpathExpr)
I am using the below scala code:
I was looking for an answer written in Java and surprisingly couldn't find any clean solutions here. After a while I was able to figure it out so I decided to add it here in case someone else is looking for the Java implementation (I guess it also works in Scala?):
JavaConversions.asScalaBuffer(myJavaList).toList()