GROOVY-6736: "as" behaves differently to "withTraits" if used on a Map