The HotSpot JvmtiHandshake and JvmtiUnitedHandshakeClosure classes were introduced in the JDK 22 to unify/simplify the JVMTI functions supporting implementation of the virtual threads. The JVMTI functions GetOwnedMonitorInfo and GetOwnedMonitorStackDepthInfo should be also refactored on the base of JvmtiHandshake/JvmtiUnitedHandshakeClosure classes.