Changed test to support new JDK versions (not only 7)