### Question:
GenericListFieldDataProvider implements FieldDataProvider<OUTPUT_TYPE, VALUE_TYPE> { @Override public VALUE_TYPE generate(OUTPUT_TYPE instance) { return mList.get((int)(mRandom.nextDouble() * mList.size())); } GenericListFieldDataProvider(Random pRandom, List<VALUE_TYPE> pList); @Override VALUE_TYPE generate(OUTPUT_TYPE instance);  }### Answer:
@Test public void givenMinRandomValueWhenGenerateThenReturnsFirstValue() { given(mRandom.nextDouble()).willReturn(0d); String result = mCut.generate(null); assertEquals("The First", result); }
@Test public void givenMaxRandomValueWhenGenerateThenReturnsLastValue() { given(mRandom.nextDouble()).willReturn(0.99999999999d); String result = mCut.generate(null); assertEquals("Eternity", result); }
@Test public void givenListIsModifiedWhenGenerateThenReturnsUnmodifiedValue() { given(mRandom.nextDouble()).willReturn(0d); mValues.set(0, "The Firstest"); String result = mCut.generate(null); assertEquals("The First", result); }