JavaLab serves as an experimental playground and knowledge base for the Java programming language. The goal of this project is to maintain a set of tests that explore various nuances and complexities of Java code. Each test aims to provide clear examples and answers to common (and not-so-common) challenges developers face when working with Java.
- JavaReleases 📅: Key features by version
- FirstSteps 👣: Java Basics
- DesignPatterns 🧩: Design Patterns in Modern Java
- CleanCode 🧼: Clean Code
- Common 🔧: Shared test utilities (e.g. capturing
System.outin assertions)
Requires JDK 25.
./gradlew test # all modules
./gradlew :JavaReleases:test # single module
./gradlew :JavaReleases:test --tests "pl.mperor.lab.java.Java8" # single test class- Tests are the documentation. Each test method demonstrates one behavior and asserts it, so every example is verified on every build.
Supporting classes live in
src/main, but the story is told insrc/test. - Start with what you need: FirstSteps for language fundamentals, JavaReleases to see what each version added, DesignPatterns and CleanCode for design.
- Each
JavaNclass starts with a header listing the release's features (language, libraries and tools for Java 1.0–9, JEP numbers for Java 10+), followed by tests for the most relevant ones.