code: <T extends Plugin> Optional<T> findFirstPlugin(Class<T> clazz) {
          requireNonNull(clazz, "clazz");
          return plugins.stream().filter(clazz::isInstance).map(clazz::cast).findFirst();
      }
docs: Returns the first {@link Plugin} of the specified {@code clazz} as wrapped by an {@link Optional}.