//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testIt() public virtual void TestIt() { int sizePerJump = 1000; IdGeneratorFactory factory = new JumpingIdGeneratorFactory(sizePerJump); IdGenerator generator = factory.Get(IdType.NODE); for (int i = 0; i < sizePerJump / 2; i++) { assertEquals(i, generator.NextId()); } for (int i = 0; i < sizePerJump - 1; i++) { long expected = 0x100000000L - sizePerJump / 2 + i; if (expected >= 0xFFFFFFFFL) { expected++; } assertEquals(expected, generator.NextId()); } for (int i = 0; i < sizePerJump; i++) { assertEquals(0x200000000L - sizePerJump / 2 + i, generator.NextId()); } for (int i = 0; i < sizePerJump; i++) { assertEquals(0x300000000L - sizePerJump / 2 + i, generator.NextId()); } }
public JumpingIdGenerator(JumpingIdGeneratorFactory outerInstance) { this._outerInstance = outerInstance; if (!InstanceFieldsInitialized) { InitializeInstanceFields(); InstanceFieldsInitialized = true; } }