@Override
  public void close() throws IOException {
    executorService.shutdown();
    try {
      executorService.awaitTermination(MULTITHREADED_TEST_TIMEOUT.getSeconds(), TimeUnit.SECONDS);

    } catch (InterruptedException ex) {
      throw new IOException(ex);
    }
  }
Testing infrastructure for running code across multiple threads.
jib-core/src/test/java/com/google/cloud/tools/jib/MultithreadedExecutor.java