Use Collection interfaces
MSALUse Deque, List, Map, ConcurrentMap, Queue, and Set instead of implemented collections. Replaces the return type of public method declarations and the variable type public variable declarations. Programming to an interface rather than a concrete collection type decouples callers from a specific implementation, making it easier to swap data structures later without breaking dependent code.
org. openrewrite. staticanalysis. UseCollectionInterfacesmod run . --recipe= org. openrewrite. staticanalysis. UseCollectionInterfacesInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.