private void runBenchmark(StopWatch stopWatch, String taskName, Tuple[] tuples, PojoCodec serializer,
			PojoCodec deserializer) throws IOException {
		stopWatch.start(taskName);
		for (int i = 0; i < ITERATIONS; i++) {
			ByteArrayOutputStream bos = new ByteArrayOutputStream();
			serializer.encode(tuples[i], bos);
			byte[] bytes = bos.toByteArray();
			Tuple result = deserializer.decode(bytes, DefaultTuple.class);
			assertEquals(tuples[i].getFieldNames(), result.getFieldNames());
			assertEquals(tuples[i].getValues(), result.getValues());
			assertNotNull(((DefaultTuple) tuples[i]).getConversionService());
		}
		stopWatch.stop();
	}
@author David Turanski
@author Gary Russell
spring-xd-benchmark/src/test/java/org/springframework/xd/tuple/serializer/kryo/TupleCodecBenchmarkTests.java