ExponentialIterator implements Iterator<Long> { @Override public Long next() { long result; if (iteration == 0) { result = Math.round(initial); } else { result = Math.round(initial + Math.pow(rate, iteration - 1)); } iteration++; return result; } ExponentialIterator(double initial,
                               double percentage); @Override boolean hasNext(); @Override Long next(); @Override void remove();  }
@Test public void shouldGenerateExponentialSequence() { ExponentialIterator iterator = new ExponentialIterator(0, 100); assertThat(iterator.next(), is(0L)); assertThat(iterator.next(), is(1L)); assertThat(iterator.next(), is(2L)); assertThat(iterator.next(), is(4L)); assertThat(iterator.next(), is(8L)); assertThat(iterator.next(), is(16L)); assertThat(iterator.next(), is(32L)); assertThat(iterator.next(), is(64L)); assertThat(iterator.next(), is(128L)); }