tests: In TestEncodeDecodeBenchmark, in toBuffer, use old style for loop for compatibility with old Java versions.