Fix Java 6 incompatibility

The test used a method that was introduced in Java 7