@Test public void shouldReturnPositiveLongBetweenZeroAndIntegerMAX() { Generator<Long> randomPositiveLongGenerator = new RandomPositiveLongGenerator(); for (int i = 0; i < 100; i++) { assertThat(randomPositiveLongGenerator.next(), greaterThanOrEqualTo(0L)); } }
@Override public Long next() { return from + random.nextLong(to - from); }
RandomPositiveLongGenerator implements Generator<Long> { @Override public Long next() { return from + random.nextLong(to - from); } }
RandomPositiveLongGenerator implements Generator<Long> { @Override public Long next() { return from + random.nextLong(to - from); } RandomPositiveLongGenerator(long from, long to);  RandomPositiveLongGenerator(); }
RandomPositiveLongGenerator implements Generator<Long> { @Override public Long next() { return from + random.nextLong(to - from); } RandomPositiveLongGenerator(long from, long to);  RandomPositiveLongGenerator(); @Override Long next(); }
RandomPositiveLongGenerator implements Generator<Long> { @Override public Long next() { return from + random.nextLong(to - from); } RandomPositiveLongGenerator(long from, long to);  RandomPositiveLongGenerator(); @Override Long next();  }