Version agnostic way to convert from Java to Scala collections and back

1.1k Views Asked by At

Almost each Scala version changes the way collection conversion happens in a non-backward compatible way. Is there a better solution that is version agnostic and does not depend on Scala distribution?

I don't mind using some 3rd party libraries.

1

There are 1 best solutions below

0
On BEST ANSWER

Just use the scala-collections-compat library and then you can use import scala.jdk.CollectionConverters._ on Scala 2.11, 2.12 & 2.13.