/** {@inheritDoc} */ @Override public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
/** @inheritDoc */ public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
/** {@inheritDoc} */ public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
/** {@inheritDoc} */ @Override public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
/** @inheritDoc */ public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
/** @inheritDoc */ public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
/** @inheritDoc */ public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
/** @inheritDoc */ public int next() { if (!hasNext()) { throw new NoSuchElementException(); } int ret = idx; idx = Bits.findFirst(bits, idx+1); return ret; } };
public void test4_findFirst2() { for (int i = 0; i < 32; i++) { assertEquals(label(i), i, Bits.findFirst(1 << i, i)); } }
public void test1_findFirst2() { for (int i = 0; i < 32; i++) { assertEquals(label(i), -1, Bits.findFirst(0, i)); } }
public void test6_findFirst2() { for (int i = 0; i < 32; i++) { int value = (1 << i); value |= (value >>> 1); assertEquals(label(i), i, Bits.findFirst(value, i)); } }
public void test1_findFirst2() { for (int i = 0; i < 32; i++) { assertEquals(label(i), -1, Bits.findFirst(0, i)); } }
public void test3_findFirst2() { for (int i = 0; i < 32; i++) { assertEquals(label(i), -1, Bits.findFirst((1 << i) >>> 1, i)); } }
public void test5_findFirst2() { for (int i = 0; i < 31; i++) { assertEquals(label(i), i + 1, Bits.findFirst(1 << (i + 1), i)); } }
public void test1_findFirst1() { int[] bits = new int[100]; for (int i = 0; i < 100; i++) { assertEquals(label(i), -1, Bits.findFirst(bits, i)); } }
public void test2_findFirst1() { int[] bits = new int[100]; for (int i = 0; i < bits.length; i++) { bits[i] = -1; } for (int i = 0; i < 100; i++) { assertEquals(label(i), i, Bits.findFirst(bits, i)); } }
public void test2_findFirst2() { for (int i = 0; i < 32; i++) { assertEquals(label(i), i, Bits.findFirst(-1, i)); } }
public void test3_findFirst2() { for (int i = 0; i < 32; i++) { assertEquals(label(i), -1, Bits.findFirst((1 << i) >>> 1, i)); } }
public void test4_findFirst2() { for (int i = 0; i < 32; i++) { assertEquals(label(i), i, Bits.findFirst(1 << i, i)); } }
public void test6_findFirst2() { for (int i = 0; i < 32; i++) { int value = (1 << i); value |= (value >>> 1); assertEquals(label(i), i, Bits.findFirst(value, i)); } }