code: public <T> T createInstance(Class<T> type, String typeName) {
          try {
              return type.cast(getType(typeName).newInstance());
          } catch (InstantiationException | IllegalAccessException e) {
              throw new IllegalArgumentException("Cannot create instance of class " + type.getName(), e);
          }
      }
docs: Create an instance of the given class.
  
  @param type     The type.
  @param typeName The type name.
  @param <T>      The type.
  @return The scanner plugin instance.