Fix compatibility of unit test with Java 6