GROOVY-6396: same linkedlist code different behavior between groovy and ...

...java