### Question:
RgbFieldDataProvider implements FieldDataProvider<OUTPUT_TYPE, String> { @Override public String generate(OUTPUT_TYPE instance) { int red = mRandom.nextInt(255); int green = mRandom.nextInt(255); int blue = mRandom.nextInt(255); if (mAlpha) { int alpha = mRandom.nextInt(255); return String.format("#%02x%02x%02x%02x", alpha, red, green, blue); } else { return String.format("#%02x%02x%02x", red, green, blue); } } RgbFieldDataProvider(Random pRandom, boolean pAlpha); @Override String generate(OUTPUT_TYPE instance);  }### Answer:
@Test public void givenARandomGeneratorAndAlphaWhenGenerateThenReturnsRGBAValue() { mCut = new RgbFieldDataProvider<>(mRandom, true); givenRandomValues(173, 250, 17, 222); String result = mCut.generate(null); assertEquals("#deadfa11", result); }
@Test public void givenARandomGeneratorAndNoAlphaWhenGenerateThenReturnsRGBValue() { mCut = new RgbFieldDataProvider<>(mRandom, false); givenRandomValues( 176, 85, 237); String result = mCut.generate(null); assertEquals("#b055ed", result); }