hacked to work with jdk7 with all tests ok