GROOVY-5839: add test case to avoid regression