diff --git a/README.md b/README.md index 81f8066..9fb1efd 100644 --- a/README.md +++ b/README.md @@ -34,5 +34,6 @@ This project includes unit tests for key functionalities introduced in each Java - [Java 20](src/test/java/pl/mperor/lab/java/Java20.java) - [Java 21](src/test/java/pl/mperor/lab/java/Java21.java) - [Java 22](src/test/java/pl/mperor/lab/java/Java22.java) +- [Java 23](src/test/java/pl/mperor/lab/java/Java23.java) For detailed examples and tests of each feature, please refer to the individual source files linked above. \ No newline at end of file diff --git a/src/test/java/pl/mperor/lab/java/Java23.java b/src/test/java/pl/mperor/lab/java/Java23.java new file mode 100644 index 0000000..5e1f898 --- /dev/null +++ b/src/test/java/pl/mperor/lab/java/Java23.java @@ -0,0 +1,54 @@ +package pl.mperor.lab.java; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import sun.misc.Unsafe; + +/// Java 23 (September 2024) +/// [JDK 23](https://openjdk.org/projects/jdk/23) +/// +/// - STANDARD FEATURES: +/// - 467: Markdown Documentation Comments +/// - 471: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal +/// - 474: ZGC: Generational Mode by Default +/// +/// - PREVIEW & INCUBATOR: +/// - 476: Module Import Declarations (Preview) +/// - 455: Primitive Types in Patterns, instanceof, and switch (Preview) +/// - 466: Class-File API (Second Preview) +/// - 473: Stream Gatherers (Second Preview) +/// - 482: Flexible Constructor Bodies (Second Preview) +/// - 477: Implicitly Declared Classes and Instance Main Methods (Third Preview) +/// - 480: Structured Concurrency (Third Preview) +/// - 481: Scoped Values (Third Preview) +/// - 469: Vector API (Eighth Incubator) +public class Java23 { + + /// This is a **Markdown** JavaDoc (starts with ///). + /// Markdown Documentation Comments are described in this [JEP](https://openjdk.org/jeps/467). + /// It supports *italic*, **bold**, and `code` formatting. + /// + /// As well: + /// - code block: + /// ```java + /// void main(){ + /// println("Unnamed entry point!"); + ///} + ///``` + /// - table: + /// + /// | JDK | Year | + /// |------|------| + /// | 17 | 2021 | + /// | 21 | 2023 | + /// | 25 | 2025 | + @Test + public void testMarkdownDocumentationComments() { + } + + @Test + public void testSunMiscUnsafeDeprecated() { + Assertions.assertThrows(SecurityException.class, Unsafe::getUnsafe); + } + +} \ No newline at end of file