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]
|Field||Original Value||New Value|
|Status||Open [ 1 ]||In Progress [ 3 ]|
|Resolution||Not A Defect [ 7 ]|
|Status||In Progress [ 3 ]||Resolved [ 5 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|