Upd: I've added the relevant tests and CI now passes. I've updated the build configuration, so the build now passes without warnings with Gradle 7.3 and Java 17.
SecurityManager has been deprecated for removal, so we might need to drop its use. Vladimir