Closed
Description
In some of our test cases, we are currently using the traditional instanceof checks followed by explicit type casting. With the introduction of Pattern Matching in recent Java versions, we can refactor these checks to make the code more concise and readable.
Example:
if (redisOperations instanceof DisposableBean) { ((DisposableBean) redisOperations).destroy(); }
Tasks:
- Locate instanceof checks in tests.
- Refactor them to use Pattern Matching.
- Ensure all tests pass after changes.
If this approach is approved, I will proceed with the changes and create a pull request.