Wrap MockedConstruction in try-with-resources

MSAL

Wraps MockedConstruction variable declarations that have explicit .close() calls into try-with-resources blocks, removing the explicit close call. This ensures proper resource management and makes the code cleaner.

org.openrewrite.java.testing.mockito.MockConstructionToTryWithResources
mod run . --recipe=org.openrewrite.java.testing.mockito.MockConstructionToTryWithResources

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.