Skip to content

java-collections

14 Posts

How to Use CountDownLatch, CyclicBarrier and Semaphore

Build a stock-sync job in plain Java 21 and use CountDownLatch, CyclicBarrier and Semaphore each where it fits, with runnable checks and the traps I forced.

How to Use flatMap in Java to Flatten Nested Lists

Flatten students, courses and assignments with flatMap, flatMapToInt, Optional.stream and mapMulti on Java 21. 22 checks, forced errors and the fixes included.