### Question:
RandomEnumFieldDataProvider implements FieldDataProvider<OUTPUT_TYPE, VALUE_TYPE> { @Override public VALUE_TYPE generate(OUTPUT_TYPE instance) { return mPossibleValues[(int)(mRandom.nextDouble() * mPossibleValues.length)]; } RandomEnumFieldDataProvider(Random pRandom, Class<VALUE_TYPE> pValue); @Override VALUE_TYPE generate(OUTPUT_TYPE instance);  }### Answer:
@Test public void givenRandomDoubleValueWhenGenerateThenReturnsIntegerValue() { given(mRandom.nextDouble()).willReturn(0d); MagicColors result = mCut.generate(null); assertEquals(MagicColors.WHITE, result); given(mRandom.nextDouble()).willReturn(0.5d); result = mCut.generate(null); assertEquals(MagicColors.BLACK, result); given(mRandom.nextDouble()).willReturn(0.99999999999d); result = mCut.generate(null); assertEquals(MagicColors.GREEN, result); }