I've created a pull request with a new version of the test case, plus changes to hibernate-core to fix the problem.
You can delete the obsolete attachments on this jira issue.