Fix test on Java 7