@Test
public void toBytes() {

    final int expectedByteCount = 115;
    int count = 100000;
    ServiceDocument s = buildCloneOrSerializationObject();
    int byteCount = 0;
    long start = System.nanoTime() / 1000;
    for (int i = 0; i < count; i++) {
        byte[] content = Utils.getBuffer(1024);
        byteCount = Utils.toBytes(s, content, 0);
        assertTrue(content != null);
        assertTrue(content.length >= expectedByteCount);
    }
    long end = System.nanoTime() / 1000;
    double thpt = end - start;
    thpt /= 1000000;
    thpt = count / thpt;
    Logger.getAnonymousLogger().info(
            String.format(
                    "Binary serializations per second: %f, iterations: %d, byte count: %d",
                    thpt, count, byteCount));
    this.testResults.getReport().lastValue(TestResults.KEY_THROUGHPUT, thpt);
}