code: @Override
    public void putAll(final Map<? extends K, ? extends V> map) {
      int mapSize = map.size();
      if (size() == 0 && mapSize != 0 && map instanceof SortedMap) {
        Comparator<?> c = ((SortedMap<? extends K, ? extends V>) map).comparator();
        if (c == comparator || (c != null && c.equals(comparator))) {
          ++modCount;
          try {
            buildFromSorted(mapSize, map.entrySet().iterator(), null, null);
          } catch (java.io.IOException cannotHappen) {
          } catch (ClassNotFoundException cannotHappen) {
          }
          return;
        }
      }
      super.putAll(map);
    }
docs: Copies all of the mappings from the specified map to this map. These mappings replace any mappings that this map had for any of
  the keys currently in the specified map.
  
  @param map
  mappings to be stored in this map
  @throws ClassCastException
  if the class of a key or value in the specified map prevents it from being stored in this map
  @throws NullPointerException
  if the specified map is null or the specified map contains a null key and this map does not permit null keys