code: public static <T> T forkJoinExecution(Callable<T> callable, ConcurrencyConfiguration concurrencyConfiguration, boolean parallelStream) {
          if(parallelStream && concurrencyConfiguration.isParallelized()) {
              try {
                  ForkJoinPool pool = new ForkJoinPool(concurrencyConfiguration.getMaxNumberOfThreadsPerTask());
                  
                  T results = pool.submit(callable).get();
                  pool.shutdown();
                  return results;
              } 
              catch (InterruptedException | ExecutionException ex) {
                  throw new RuntimeException(ex);
              }
          }
          else {
              try {
                  return callable.call();
              } 
              catch (Exception ex) {
                  throw new RuntimeException(ex);
              }
          }
      }
docs: Alternative to parallelStreams() which executes a callable in a separate
  pool.
  
  @param <T>
  @param callable
  @param concurrencyConfiguration
  @param parallelStream
  @return