Callbacks attached to already completed CompletionStages returned by CompletableFuture#completedStage() static factory method should be called just after being attached, but they are not. The issue doesn't occur when #completedFuture is being used instead.
Example:
public class CompletionStageTest
{
public static void main(String[] args) {
CompletableFuture<String> future1 = new CompletableFuture<>();
future1.thenAccept(System.out::println);
future1.complete("Future 1");
CompletionStage<String> future2 = CompletableFuture.completedFuture("Future 2");
future2.thenAccept(System.out::println);
CompletionStage<String> future3 = CompletableFuture.completedStage("Future 3");
future3.thenAccept(System.out::println);
}
}
The last callback printing "Future 3" is not executed but it should be.