How to Use EnumMap and EnumSet in Java 21 (Rota Example)
Build an on-call rota in Java 21 with EnumSet for roles and gaps and EnumMap for schedules and counts, then trigger ten traps that bite in real code.
Build an on-call rota in Java 21 with EnumSet for roles and gaps and EnumMap for schedules and counts, then trigger ten traps that bite in real code.
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.
Flatten students, courses and assignments with flatMap, flatMapToInt, Optional.stream and mapMulti on Java 21. 22 checks, forced errors and the fixes included.
How to use LinkedHashMap in Java 21: keep insertion order, move entries, and build a small LRU cache with access order, on a library catalogue with 22 checks.