// generateTimeBasedUUID(EthernetAddress) method
EthernetAddress ethernet_address =
new EthernetAddress("87:F5:93:06:D3:0C");
// we need a instance to use
TimeBasedGenerator uuid_gen = Generators.timeBasedGenerator(ethernet_address);
// check that given a number of calls to generateTimeBasedUUID,
// all returned UUIDs order after the last returned UUID
// we'll check this by generating the UUIDs into one array and sorting
// then in another and checking the order of the two match
// change the number in the array statement if you want more or less
// UUIDs to be generated and tested
UUID uuid_array[] = new UUID[SIZE_OF_TEST_ARRAY];
// before we generate all the uuids, lets get the start time
long start_time = System.currentTimeMillis();
// now create the array of uuids
for (int i = 0; i < uuid_array.length; i++) {
uuid_array[i] = uuid_gen.generate();
}
// now capture the end time
long end_time = System.currentTimeMillis();