Update code to Java 8