docs: @SuppressWarnings("unchecked")
      <PreferredType, AlternateType> Object loadPlugin(final Class<PreferredType> preferredPluginType, final Class<AlternateType> alternatePluginType) {
          try {
              PreferredType preferredPlugin = initializer.loadImpl(preferredPluginType);
              if (preferredPlugin != null) {
                  return preferredPlugin;
              } else if (alternatePluginType != null) {
                  AlternateType alternatePlugin = initializer.loadImpl(alternatePluginType);
                  if (alternatePlugin != null) {
                      return alternatePlugin;
                  }
              }
  
              return plugins.getDefaultPlugin(preferredPluginType);
          } catch (final Throwable t) {
              return Proxy.newProxyInstance(preferredPluginType.getClassLoader(),
                  new Class<?>[]{preferredPluginType},
                  new InvocationHandler() {
                      @Override
                      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                          throw new IllegalStateException("Could not initialize plugin: " + preferredPluginType + " (alternate: " + alternatePluginType + ")", t);
                      }
                  });
          }
      }