In a Pipeline ArrayList.empty is applied to each element of the list and returns another ArrayList.
In a normal console Groovy script ArrayList.empty returns a boolean value which answers, whether the list empty or not.
What is the reason for this difference? Is it expected or a bug? I always thought that when I call Java class method in the Pipeline script it should work like in Java. From this point of view it seems as a bug.
Groovy command line output:
listB.empty=[false, false, false]