Re:All New Java Language Features Since Java 21
by vips7L on Saturday September 06, 2025 @10:42AM
(#45149698)
Using var there doesn’t leak any implementation details into any contracts. Var is for local variables inside of functions. There are no details or contracts there.
You would like to use Map<Key, Value> items = new HashMap<>() since in general you do not want implementation detail leaking into contracts