code: private static <K, V> Set<K> synchronizedCopyKeys(Map<K, V> map) {
  
          if (map == null) {
              return new HashSet<K>();
          }
          synchronized (map) {
              return new HashSet<K>(map.keySet());
          }
      }
docs: Copies the key set of a map while synchronizing on the map.<p>
  
  @param map the map whose key set should be copied
  @return the copied key set