Converting Java collections to Scala collections from Java

July 7, 2016

Converting between Java and Scala collections from Scala code is remarkably easy -

But doing the same from Java is a little more difficult. We can see what Scala is doing under the hood by using reify then use the same approach from Java -

In order to pull this off in Java, we can just follow the calls presented in the desugared ASTs from above -