Yeah, I didn't read the test properly and I thought it was using TransactionXaAdapter.prepare/commit to check the locks before sending the prepare/commit (confusion with InitiatorCrashPessimisticTest, perhaps). 

Maybe the comment could be clearer, e.g "before the prepare is received on the coordinator", but I wouldn't ask for a new PR just for that :)