As explained in the PR ( https://github.com/hibernate/hibernate-orm/pull/2363 ), the issue was with the JDK 9 compiler being smarter and interpreting the generics in a way that made the OP's code fail.
A solution was found.