### Question:
ListGenerator implements Generator<List<T>> { @Override public List<T> next() { final int size = randomValues.randomInteger(sizeRange.lowerBound(), sizeRange.upperBound()); final List<T> listOfTs = new LinkedList<>(); for (int i = 0; i < size; i++) { listOfTs.add(generatorOfT.next()); } return listOfTs; } ListGenerator(final RandomValues randomValues, final Generator<? extends T> generatorOfT, final Range<Integer> sizeRange); @Override List<T> next();  }### Answer:
@Test public void generatesListOfGeneratedValues() { final Generator<List<Integer>> generator = RDG.list(generatingFrom(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), 5); assertThat(generator.next()).containsExactly(1, 2, 3, 4, 5); }
@Test public void generatesEmptyListForSizeOfZero() { final Generator<List<Integer>> generator = RDG.list(generatingRandomIntegers(), 0); assertThat(generator.next()).isEmpty(); }
@Test public void generatesEmptyListForFixedSizeOfZero() { final Generator<List<Integer>> generator = RDG.list(generatingRandomIntegers(), fixed(0)); assertThat(generator.next()).isEmpty(); }
@Test public void generatesListsOfSizeUpToMaximum() { assertThat(RDG.list(generatingRandomIntegers(), MAX_SIZE).next()).hasSize(MAX_SIZE); assertThat(RDG.list(generatingRandomIntegers(), fixed(MAX_SIZE)).next()).hasSize(MAX_SIZE); }
@Test public void sizeGreaterThanMaximumReturnsListOfMaximumSize() { assertThat(RDG.list(generatingRandomIntegers(), MAX_SIZE + 1).next()).hasSize(MAX_SIZE); }
@Test public void fixedSizeRangeGreaterThanMaximumReturnsListOfMaximumSize() { assertThat(RDG.list(generatingRandomIntegers(), fixed(MAX_SIZE + 1)).next()).hasSize(MAX_SIZE); }
@Test public void closedRangeWithUpperBoundGreaterThanMaximumReturnsListOfMaximumSize() { assertThat(RDG.list(generatingRandomIntegers(), closed(MAX_SIZE + 1, MAX_SIZE + 1)).next()).hasSize(MAX_SIZE); }
@Test public void generatesEmptyListForNegativeSize() { assertThat(RDG.list(generatingRandomIntegers(), -1).next()).isEmpty(); }
@Test public void generatesListAtLeastWithSizeZeroWhenLowerBoundIsNegative() { assertThat(RDG.list(generatingRandomIntegers(), Range.closed(-1, 0)).next()).isEmpty(); }