Internal utility classes reimplemented for Java 21 and later versions.