Fix HooksTest to work with JDK6