docs: public void getState(OutputStream ostream) throws Exception {
          HashMap<K,V> copy=new HashMap<>();
          for(Map.Entry<K,V> entry:entrySet()) {
              K key=entry.getKey();
              V val=entry.getValue();
              copy.put(key, val);
          }
          try(ObjectOutputStream oos=new ObjectOutputStream(new BufferedOutputStream(ostream, 1024))) {
              oos.writeObject(copy);
          }
      }