### Question:
GenerationSafePointer { static short checksumOf( long generation, long pointer ) { short result = 0; result ^= ((short) generation) & UNSIGNED_SHORT_MASK; result ^= ((short) (generation >>> Short.SIZE)) & UNSIGNED_SHORT_MASK; result ^= ((short) pointer) & UNSIGNED_SHORT_MASK; result ^= ((short) (pointer >>> Short.SIZE)) & UNSIGNED_SHORT_MASK; result ^= ((short) (pointer >>> Integer.SIZE)) & UNSIGNED_SHORT_MASK; return result; } private  GenerationSafePointer(); static boolean isEmpty( long generation, long pointer );  }### Answer:
@Test void shouldHaveLowAccidentalChecksumCollision() { int count = 100_000; GSP gsp = new GSP(); int collisions = 0; short reference = 0; for ( int i = 0; i < count; i++ ) { gsp.generation = random.nextLong( GenerationSafePointer.MAX_GENERATION ); gsp.pointer = random.nextLong( GenerationSafePointer.MAX_POINTER ); short checksum = checksumOf( gsp ); if ( i == 0 ) { reference = checksum; } else { boolean unique = checksum != reference; collisions += unique ? 0 : 1; } } assertTrue( (double) collisions / count < 0.0001 ); }