Replace Java 8 methods with their older counterparts. Thanks to @matthijs2704.