Code example for UUID

Methods: clockSequence, node, timestamp, variant, version

0
import java.util.UUID; 
 
import org.apache.harmony.testframework.serialization.SerializationTest; 
 
@TestTargetClass(UUID.class) 
public class UUIDTest extends TestCase {
 
    /** 
     * @see UUID#UUID(long, long) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "UUID", 
        args = {long.class, long.class} 
    ) 
    public void test_ConstructurJJ() { 
        UUID uuid = new UUID(0xf81d4fae7dec11d0L, 0xa76500a0c91e6bf6L);
        assertEquals(2, uuid.variant());
        assertEquals(1, uuid.version());
        assertEquals(0x1d07decf81d4faeL, uuid.timestamp());