Issue #3154416 by novchuk.v: Replace assert* involving an instanceof operator with assertInstanceOf()/assertNotInstanceOf().