Fix tests for JDK 8.