class FanOutFanIn {

  /**
   * the main fanOutFanIn function or orchestrator function.
   * @param requests List of numbers that need to be squared and summed up
   * @param consumer Takes in the squared number from {@link SquareNumberRequest} and sums it up
   * @return Aggregated sum of all squared numbers.
   */
  public static Long fanOutFanIn(
      final List<SquareNumberRequest> requests, final Consumer consumer) {<FILL_FUNCTION_BODY>}
}


    ExecutorService service = Executors.newFixedThreadPool(requests.size());

    // fanning out
    List<CompletableFuture<Void>> futures =
        requests.stream()
            .map(
                request ->
                    CompletableFuture.runAsync(() -> request.delayedSquaring(consumer), service))
            .toList();

    CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();

    return consumer.getSumOfSquaredNumbers().get();
  
<no_super_class>