Simplify Resource Cleanup in JUnit with the New @AutoClose Annotation
The article introduces JUnit's @AutoClose annotation (added in version 5.11), compares the traditional @BeforeEach/@AfterEach cleanup pattern with the annotation's automatic resource closing, and demonstrates its use across file I/O, database connections, HTTP clients, streams, and custom AutoCloseable classes, including warning behavior for null fields.
