static CompletionStage<Member> decorateMember(int memberId) {
      return CompletableFuture.supplyAsync(() -> {
        /*
         * Introduce some lag to mimic remote call. In real use cases, this typically translates to over the wire
         * network call to some rest service.
         */
        try {
          Thread.sleep((long) (Math.random() * 10000));
        } catch (InterruptedException ec) {
          System.out.println("Interrupted during sleep");
        }

        return new Member(memberId, getRandomGender(), getRandomCountry());
      });
    }
A mock member decorator service that introduces delay to the member decorate call for illustrating async APIs
use in high level application. In real world, this component would correspond to a component that makes remote
calls.
samza-test/src/main/java/org/apache/samza/example/AsyncApplicationExample.java