GROOVY-6012: Replace anonymous inner class with instance initializer