docs: public static void registerExtension(String key, Extension extension) {
          if (key == null || extension == null) {
              throw new IllegalArgumentException(
                              "Neither 'key' nor 'extension' parameter can be null.");
          }
          w.lock();
          try {
              if (extensionMap.containsKey(key)) {
                  throw new IllegalArgumentException("Extension with the key "
                                                     + key + " is registered already");
              }
              extensionMap.put(key, new WeakReference<Extension>(extension));
          } finally {
              w.unlock();
          }
      }