Who's behind Java Pills?
Massimiliano Cova, a senior backend developer passionate about Spring Reactive and tech communication. Java Pills started on LinkedIn. Here you can explore them all, sorted and gathered in a single archive.
-
12 Jul 2025
π #16: ArgumentCaptor β gotta test 'em all!
Mockito ArgumentCaptor: beyond a plain verify(), inspecting the arguments actually passed to a mocked method to test side-effects too.
-
03 Jul 2025
π #15: Orchestrator + Strategy = fallback with style!
Combining the orchestrator pattern and the strategy pattern to handle dynamic fallbacks (e.g. audio transcription): decoupled, extensible and testable code.
-
21 Jun 2025
π #14: Is Mono a lazybones? It depends!
Mono.just() evaluates its argument immediately (eager), Mono.fromCallable() defers execution until subscription (lazy): handy for potentially blocking operations.
-
17 Jun 2025
π #13: Where does the Mono run?
A Mono's execution thread changes when you use subscribeOn(): by default it's the subscriber's thread, with boundedElastic() it moves to the pool dedicated to blocking I/O operations.
-
24 Mar 2025
π #12: The zip methods with a combinator
Using the combinator variants of Mono.zip, zipWith and zipWhen to get a well-typed object directly instead of a Tuple2, plus a custom helper for the N-Mono case (with N > 2).
-
04 Mar 2025
π #11: Agile Git Flow with hierarchical merging
A variant of Git Flow hybridised with Trunk-Based Development for agile teams: 4 branch levels (master/develop/sprint/feature), squash merges from child to parent and a clean history.
-
16 Feb 2025
π #10: Migrating a BE architecture to a new data model
Horizontal refactoring of the repositories, vertical refactoring of services and converters, ~100 integration tests, over 500 unit tests, and a 4-branch git strategy to migrate the data model without blocking ongoing development.
-
12 Feb 2025
π #9: Solving development problems with AI β from prompt to code
Delegating a Java list-aggregation problem to ChatGPT: an abstract prompt (no domain leak) + a solution with Collectors.groupingBy and flatMap.
-
06 Nov 2024
π #8: Eager and lazy strategies compared with Optional and Mono (WebFlux)
Differences between orElse and orElseGet on Optional, switchIfEmpty with and without defer on Mono: eager vs lazy strategies and when to pick each one to avoid side-effects.
-
28 Oct 2024
π #7: Backpressure with WebFlux β the hookOnSubscribe and hookOnNext methods
How to control the flow of data between publisher and subscriber with BaseSubscriber, hookOnSubscribe and hookOnNext: batched requests to avoid overloads.