Fix unit test under JDK6