private <X> Map<T, X> copyMap(final Map<T, X> map) {
    //noinspection deprecation
    Map<T, X> copy = new SoftHashMap<>(map.size());
    copy.putAll(map);
    return copy;
  }
private <X> Map<T, X> copyMap(final Map<T, X> map)