Switching code to Java 8 compatible.