@Test public void generatorWithDifferentTime() throws Exception { FlakeId id3 = new DummyFlakeGenerator(1, fixed(1, 3), "gen3").next(); assertEquals(1420243200000L, id3.epochMilli()); assertEquals(724775731200001L, id3.value()); FlakeId id4 = new DummyFlakeGenerator(1, fixed(1, 4), "gen4").next(); assertEquals(1420329600000L, id4.epochMilli()); assertEquals(1087163596800001L, id4.value()); }
public final FlakeId next() { return new FlakeId(getCurrentSequenceTime(), nodeId); }
FlakeIdGenerator { public final FlakeId next() { return new FlakeId(getCurrentSequenceTime(), nodeId); } }
FlakeIdGenerator { public final FlakeId next() { return new FlakeId(getCurrentSequenceTime(), nodeId); } protected  FlakeIdGenerator(int nodeId); @VisibleForTesting  FlakeIdGenerator(int nodeId, Clock clock, String scope); }
FlakeIdGenerator { public final FlakeId next() { return new FlakeId(getCurrentSequenceTime(), nodeId); } protected  FlakeIdGenerator(int nodeId); @VisibleForTesting  FlakeIdGenerator(int nodeId, Clock clock, String scope); final FlakeId next(); final int getNodeId(); }
FlakeIdGenerator { public final FlakeId next() { return new FlakeId(getCurrentSequenceTime(), nodeId); } protected  FlakeIdGenerator(int nodeId); @VisibleForTesting  FlakeIdGenerator(int nodeId, Clock clock, String scope); final FlakeId next(); final int getNodeId();  }