Fix the compatibility with Java 7 in tests for IO.