GROOVY-5925 Casting map as Random results in java.lang.VerifyError (minor refactoring)