public static void expungeStaleEntries(@NotNull Map<?, ?> map) {
    if (map instanceof com.intellij.util.containers.WeakHashMap) {
      ((com.intellij.util.containers.WeakHashMap<?, ?>)map).processQueue();
    }
    else if (map instanceof java.util.WeakHashMap) {
      // Calling the size() method forces cleansing of the WeakHashMap
      //noinspection ResultOfMethodCallIgnored
      map.size();
    }
  }
public static void expungeStaleEntries(@NotNull Map<?, ?> map)