Configure spin plugin programmatically in spring

How to configure the below spin plugin programmatically in Spring to default process engine?

  <process-engine name="default">
    <plugins>
      <plugin>
        <class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
      </plugin>
    </plugins>
  </process-engine>

Create an instance of the plugin and add it to the processEngineConfiguration#getProcessEnginesPlugin list.

Thanks @jangalinski.

Do we have already working example/implementation available. It would be helpful.

I have added Spin plugin like below, i hope it wont reset other process engine plugins which was created by application by default while bootstrap.

  @Bean
  public SpringProcessEngineConfiguration processEngineConfiguration() {
    SpringProcessEngineConfiguration engineConfiguration = new SpringProcessEngineConfiguration();
    engineConfiguration.getProcessEnginePlugins().add(new SpinProcessEnginePlugin());
    return engineConfiguration;
  }

Is that also required to configure below configurations? I hope the below config not required. Because default process engine should take care of initialization of below. I was just adding Spin plugin to default process engine configuration

@Bean
  public ProcessEngineFactoryBean processEngine() {
    ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean();
    factoryBean.setProcessEngineConfiguration(processEngineConfiguration());
    return factoryBean;
  }

  @Bean
  public RepositoryService repositoryService(ProcessEngine processEngine) {
    return processEngine.getRepositoryService();
  }

  @Bean
  public RuntimeService runtimeService(ProcessEngine processEngine) {
    return processEngine.getRuntimeService();
  }

  @Bean
  public TaskService taskService(ProcessEngine processEngine) {
    return processEngine.getTaskService();
  }
... other beans config