code: private static PipelineResult runTaskWithClassLoader(
        final TransformTask task, final ClassLoader loader)
        throws IOException, InterruptedException {
      RunnableFuture<PipelineResult> future = new FutureTask<PipelineResult>(
          new Callable<PipelineResult>() {
            @Override
            public PipelineResult call() throws Exception {
              return task.run();
            }
          });
  
      Executors.newSingleThreadExecutor(
          new ThreadFactory() {
            @Override
            public Thread newThread(Runnable r) {
              Thread taskThread = new Thread(r, "transform-task");
              taskThread.setContextClassLoader(loader);
              return taskThread;
            }
          }).execute(future);
  
      try {
        return future.get();
      } catch (ExecutionException e) {
        Throwables.propagateIfInstanceOf(e.getCause(), IOException.class);
        throw Throwables.propagate(e.getCause());
      }
    }
docs: Runs a task with the given {@link ClassLoader} as the context loader.
  
  @param task a {@link TransformTask}
  @param loader a {@link ClassLoader}
  @return the result of {@link TransformTask#run}
  @throws IOException if the task throws an IOException
  @throws InterruptedException if the task execution is interrupted