Miro Cupak gave a presentation on writing clean Java code in 2018. He discussed several new features in Java including factory methods for collections that provide immutable collections, improved try-with-resources for closing resources, adding private methods to interfaces, enhancements to the Stream API, extensions to Optional like ifPresentOrElse, and local variable type inference using var. He provided best practices for using each of these features such as preferring immutable collections, always using try-with-resources, keeping default methods and private methods short, and being careful when combining type inference with generics.