You have probably written flatMap hundreds of times. However, you may never have called it a monad, and that is perfectly fine. In this article, we will look at the one pattern that Optional, Stream and CompletableFuture share. Then we will see what the monad laws promise, and why that promise matters in daily work. …