void (RunConfiguration config, boolean enabled, RunManagerImpl runManager) { List<BeforeRunTask<?>> tasks = RunManagerImplKt.doGetBeforeRunTasks(config); BeforeRunTaskProvider<T> provider = BeforeRunTaskProvider.getProvider(myProject, getTaskId()); if (provider == null) { return; } T task = Objects.requireNonNull(provider.createTask(config)); update(task); task.setEnabled(true); if (enabled) { if (!tasks.contains(task)) { tasks = new SmartList<>(tasks); tasks.add(task); } } else { if (tasks.contains(task)) { tasks = new SmartList<>(tasks); tasks.remove(task); } } runManager.setBeforeRunTasks(config, tasks); }