GROOVY-4993: Implementation of @Memoized annotation (minor refactoring)