Using
java -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_<method_name>[,...]
for instance
java -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_equals,_hashCode
As @apangin noted, you can first use -XX:+PrintIntrinsics to see which methods are actually built into your test and disable them.
source share