Update code to JDK 8 compatible.