code: @SuppressWarnings("unchecked")
      public <P extends DiagnosticsPlugin> P getPlugin(Class<P> pluginClass) {
          return (P) pluginsMap.get(pluginClass);
      }
docs: Gets the plugin for a given plugin class. This method should be used if
  the plugin instance is required within some data-structure outside of the
  Diagnostics.
  
  @param pluginClass the class of the DiagnosticsPlugin
  @param <P>         type of the plugin
  @return the DiagnosticsPlugin found, or {@code null} if not active