GROOVY-7052: Make sure stubs take traits into account properly