UuidUtils { public long toUnixTimestamp(final UUID uuid) { return (uuid.timestamp() / 10000L) + EPOCH_MILLIS; }  long toUnixTimestamp(final UUID uuid);  }
@Test public void testTimestamps() throws Exception { final UUID uuid = Generators.timeBasedGenerator().generate(); final long unixTimestamp = uuidUtils.toUnixTimestamp(uuid); final long nowTime = System.currentTimeMillis(); LOG.info("UnixMsFromUUID=" + unixTimestamp + ", nowMs=" + nowTime + ", delta=" + (nowTime - unixTimestamp)); final long deltaNowEvent1 = Math.abs(nowTime - unixTimestamp); assertTrue(deltaNowEvent1 <= 5); }