I am trying to run two void method1 and method2 async and then block the code until both methods are done.
Does this achieve that?
CompletableFuture<Void> future1 = CompletableFuture.runAsync(() -> method1());
CompletableFuture<Void> future2 = CompletableFuture.runAsync(() -> method2());
CompletableFuture.allOf(future1, future2).join();