Fix tests on JDK8