Make test succeed for Java 6 and 7