It appears that the Java implementation of Hamcrest is at version 2.2 now: https://github.com/hamcrest/JavaHamcrest/releases Judging from the release notes this should also fix compatibility issues with JDK 11 (e.g. bug #751379).
Solved with https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-java/hamcrest/hamcrest-2.2.ebuild?id=b3702b18f502f88733cb382a777d26fc953fb4d7