Modified test to work on Java 7 and 8 - it was broken due to differences
in floating-point rounding behavior.