@Test
public void testFastOpIdExtraction() {

	
	/* 4 byte taskid; 4 byte opid */
	XTraceMetadata md = new XTraceMetadata(new TaskID(4), (int) 0);
	assertEquals("00000000", IoUtil.fastOpIdExtraction(md.toString()));
	/* 4 byte taskid; 8 byte opid */
	md = new XTraceMetadata(new TaskID(4), (long) 0);
	assertEquals("0000000000000000", IoUtil.fastOpIdExtraction(md.toString()));
	/* 12 byte taskid; 4 byte opid */
	md = new XTraceMetadata(new TaskID(12), (int) 0);
	assertEquals("00000000", IoUtil.fastOpIdExtraction(md.toString()));
	/* 12 byte taskid; 8 byte opid */
	md = new XTraceMetadata(new TaskID(12), (long) 0);
	assertEquals("0000000000000000", IoUtil.fastOpIdExtraction(md.toString()));
	
	/* 10,000 stochastic tests */
	final int NUM_TESTS = 10000;
	
	for (int i = 0; i < NUM_TESTS; i++) {
		
		if (rnd.nextBoolean()) {
			// 4-byte opid
			md = new XTraceMetadata(tasks[rnd.nextInt(4)], rnd.nextInt());
		} else {
			// 8-byte opid
			md = new XTraceMetadata(tasks[rnd.nextInt(4)], rnd.nextLong());
		}
		
		assertEquals(md.getOpIdString(), IoUtil.fastOpIdExtraction(md.toString()));
	}
}