@Test
public void testExactSizeMatch() {

  SamplingLongPrimitiveIterator t = new SamplingLongPrimitiveIterator(
      countingIterator(10), 1);
  for (int i = 0; i < 10; i++) {
    assertTrue(t.hasNext());
    assertEquals(i, t.next().intValue());
  }
  assertFalse(t.hasNext());
}