Since SPR-15196, the behavior of `Assert` methods changed and some were deprecated. This commit adapts to the new error mechanism implemented in `Assert.instanceOf`. Fixes gh-8140
Since SPR-15196, the behavior of `Assert` methods changed and some were deprecated. This commit adapts to the new error mechanism implemented in `Assert.instanceOf`. Fixes gh-8140