code: @CheckForNull
      public PluginWrapper getPlugin(Class<? extends Plugin> pluginClazz) {
          for (PluginWrapper p : getPlugins()) {
              if(pluginClazz.isInstance(p.getPlugin()))
                  return p;
          }
          return null;
      }
docs: Get the plugin instance that implements a specific class, use to find your plugin singleton.
  Note: beware the classloader fun.
  @param pluginClazz The class that your plugin implements.
  @return The plugin singleton or {@code null} if for some reason the plugin is not loaded.
  The fact the plugin is loaded does not mean it is enabled and fully initialized for the current Jenkins session.
  Use {@link Plugin#getWrapper()} and then {@link PluginWrapper#isActive()} to check it.