I know that in general, you should only use immutable objects as a key to a hashmap since if their address or their contents change, then the hash breaks. This is one of the reasons why a normal List shouldn’t be used as a key to a hashmap in Java. However, the function List.of() returns an immutable list.
Is it good practice to use lists returned by List.of() as keys in a HashMap?