Fix test so it will work on JDK 8