@Test public void shouldGenerateClosedRangeOfLongsWhenFirstGeneratedIsLower() { given(generator.next()).willReturn(lower, upper); Range<Long> integerRange = randomRangeGenerator.next(); assertThat(integerRange, is(Range.closed(lower, upper))); }
@Override public Range<T> next() { T a = delegate.next(); T b = delegate.next(); T lower = Ordering.natural().min(a, b); T upper = Ordering.natural().max(a, b); return closed(lower, upper); }
RandomClosedRangeGenerator implements Generator<Range<T>> { @Override public Range<T> next() { T a = delegate.next(); T b = delegate.next(); T lower = Ordering.natural().min(a, b); T upper = Ordering.natural().max(a, b); return closed(lower, upper); } }
RandomClosedRangeGenerator implements Generator<Range<T>> { @Override public Range<T> next() { T a = delegate.next(); T b = delegate.next(); T lower = Ordering.natural().min(a, b); T upper = Ordering.natural().max(a, b); return closed(lower, upper); } RandomClosedRangeGenerator(@Nonnull Generator<T> delegate); }
RandomClosedRangeGenerator implements Generator<Range<T>> { @Override public Range<T> next() { T a = delegate.next(); T b = delegate.next(); T lower = Ordering.natural().min(a, b); T upper = Ordering.natural().max(a, b); return closed(lower, upper); } RandomClosedRangeGenerator(@Nonnull Generator<T> delegate); @Override Range<T> next(); }
RandomClosedRangeGenerator implements Generator<Range<T>> { @Override public Range<T> next() { T a = delegate.next(); T b = delegate.next(); T lower = Ordering.natural().min(a, b); T upper = Ordering.natural().max(a, b); return closed(lower, upper); } RandomClosedRangeGenerator(@Nonnull Generator<T> delegate); @Override Range<T> next();  }