Code snippets for articles posted at 4comprehension.com provided "as-is" and organized using the one-top-level-module-per-series strategy.
- Bypassing Kotlin’s Null-Safety (snippets)
- Maintaining PriorityQueue Order with Java Streams (snippets)
- Sneakily Throwing Exceptions in Lambda Expressions in Java (snippets)
- Hamming Error Correction with Kotlin Series (snippets)
- A Kotlin Type-Inference Puzzler (snippets)
- Kotlin: Beware of Java Stream API Habits (snippets)
- Leveraging Lambda Expressions for Lazy Evaluation in Java (snippets)
- Effectively Sealed Classes in Java (snippets)
- CompletableFuture Timeouts in Java (snippets)
- Implementing a Sliding Window Stream/Spliterator in Java (snippets)
- The Ultimate Guide to the Java Stream API groupingBy() Collector (snippets)
- Java 11 String API Updates (snippets)
- Java 10 Immutable/Unmodifiable Stream API Collectors (snippets)
- Kotlin Collections API Performance Antipatterns (snippets)
- Revisiting the Template Method Design Pattern in Java (snippets)
- A Case Study of Implementing an Efficient Shuffling Stream/Spliterator in Java (snippets)
- A New JDK12 Stream API Collector – Collectors#teeing (snippets)
- Streaming Java CompletableFutures in Completion Order (snippets)
- An Ultimate Guide to Java Stream API Collectors (snippets)
- Improving CompletableFuture#allOf/anyOf API Java Methods (snippets)
- Parallel Collection Processing: Without Parallel Streams (1/3) (snippets)
- Parallel Collection Processing: Leveraging Batching (2/3) (snippets)
- Parallel Collection Processing: With Parallel Collectors (3/3) (snippets)
- Backward-Compatible Thread#onSpinWait with MethodHandles (snippets)
- Explaining Event Sourcing with Data Structures (1/3) (snippets)
- Spring's Lightweight JPA/Hibernate Alternatives (snippets)
- GitHub Actions, reveal.js, and Automating PDF Conversion (snippets)
- Be Careful with CompletableFuture.applyToEither and Exceptions (snippets)
- Improving Java's Visibility Modifiers with ArchUnit (snippets)
- How to Stop a Java Thread Without Using Thread.stop()? (snippets)
In most cases, I'm using a simple unit-testing infrastructure to squeeze multiple examples in a single file - it's enough to import the module in your IDE and run JUnit tests.
However, there might be some exceptions - in such cases, you will find instructions in matching articles