Fixed tests to work on Java 5 and Java 6