Need separate module for java 21 tests
As requested [here](https://github.com/mockito/mockito/pull/3173#issuecomment-1826754327) and [here](https://github.com/mockito/mockito/pull/3167#discussion_r1405377557), Mockito would benefit from a separate module with java 21 language level for testing newer language features that aren't available in Java 11.

Note: I have a PR ready for this.
settings.gradle.kts
settings.gradle.kts subprojects/java21/java21.gradle
diff --git a/settings.gradle.kts b/settings.gradle.kts
index ecc1e15460..b90dea2ee6 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -22,7 +22,8 @@ include(
     "osgi-test",
     "bom",
     "errorprone",
-    "programmatic-test"
+    "programmatic-test",
+    "java21"
 )
 
 // https://developer.android.com/studio/command-line/variables#envar
diff --git a/subprojects/java21/java21.gradle b/subprojects/java21/java21.gradle
new file mode 100644
index 0000000000..9a2415d516
--- /dev/null
+++ b/subprojects/java21/java21.gradle
@@ -0,0 +1,24 @@
+apply from: "$rootDir/gradle/dependencies.gradle"
+apply from: "$rootDir/gradle/java-test.gradle"
+
+description = "Test suite for Java 21 Mockito"
+
+dependencies {
+    implementation project.rootProject
+    testImplementation libraries.junit4
+    testImplementation libraries.assertj
+}
+
+java {
+    sourceCompatibility = JavaVersion.VERSION_21
+    targetCompatibility = JavaVersion.VERSION_21
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(21)
+    }
+}
+
+tasks.named('test') {
+    if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
+        enabled = false
+    }
+}
