Compiles successfully with Gradle on Java 8