Groovy's Scala call: how to handle different types of collections?

I use Groovy for testing and Scala for actual code . Obviously, I often use Scala collection types, but when I generate test data in Groovy, I often use java.util types. * -.

I started writing static conversion methods based on the scalaj-collection library . But it's just not "groovy".

What is the best way to convert one to another? Can implicit conversions work somehow?

UPDATE:

For example, if I had not manually converted the types, of course I get:

groovy.lang.MissingMethodException: 
No signature of method: static setup is applicable for argument types: (java.util.ArrayList)
    Possible solutions: setup(scala.collection.immutable.List)
+3
source share
2

"" ?

import scala.collection.JavaConversions._
0

, Scala, Java , Scala.

0

Source: https://habr.com/ru/post/1777428/


All Articles