more fixes to run HooksTest with both JDK 6 and 7