I have a Map in Java containing a number of key/value pairs.
I want to create a version of this Map with additional key/value pairs, but without losing the old version.
The simple solution would be to copy the old Map, and then add the additional key/value pairs, but I understand that there are immutable Map algorithms that can achieve this more efficiently.
Can anyone point me to such an implementation usable in vanilla Java (ie. not a Clojure or Scala library)?
The collections library at https://pcollections.org/ appears to provide efficient persistent collection implementations.