Get to know the basics of JUnit 5: @Test, lifecycle methods, assertions, and assumptions; how to disable, name, and tag tests; as well as previews on nesting, parameterization, and test interfaces. Let’s write some tests!
How to set up JUnit 5 so tests run in IntelliJ, Eclipse, Maven, Gradle or, if all else fails, via JUnit 4 or on the command line.
With ‘var’ it is possible to ad-hoc combine traits into an instance that matches your exact requirements. This allows for pretty cool experimentation, but unfortunately has some serious downsides.
Local-variable type inference with `var` makes it easier to work with anonymous classes, for example to create ad-hoc fields and methods. But does that mean you should use them more often? I think not.
With ‘var’ it is much easier to work with intersection types in Java 10 and later. You still need non-trivial tricks with generics to declare intersection types, but thanks to ‘var’ it is now easy to create local variables of such types.
Multi-release JARs allow you to create a single JAR that contains bytecode for several Java versions with jar –version 9 (or 10, or…). Presented with a multi-release JAR, JVMs version 9 and later will load the code that was included for their version.
So, Java 9 came out last year… What now? Where to get started? If that’s what you’re asking yourself, then you’ve come to the right place! This Java 9 tutorial is a condensation of all you need to know to find your way around the new release, to get you ready to explore it in more depth.
2017 draws to a close and 2018 is knocking. My annual review and preview went to my newsletter, so subscribe or head over to Medium to read them.
Want to build with Maven on Java 9? Here’s which versions to pick, how to use the compiler executable, toolchains, and mavenrc to run Maven on Java 9, and how to use mvn/jvm.config and profiles to configure your build for Java 8 and 9.
Java 10 introduces ‘var’ which lets the compiler infer local variable types. Here’s how it works, why it exists, and how it impacts readability.