### Question:
PaddedFieldDataProvider implements FieldDataProvider<OUTPUT_TYPE, String> { @Override public String generate(OUTPUT_TYPE instance) { String generatedString = getGeneratedString(instance); int charactersMissing = mMinimumLength - generatedString.length(); StringBuilder stringBuilder = getStringBuilderWithPadding(charactersMissing); return stringBuilder .append(generatedString) .toString(); } PaddedFieldDataProvider(int pMinimumLength, String pPaddingString, FieldDataProvider<OUTPUT_TYPE, ?> pFieldDataProvider); @Override String generate(OUTPUT_TYPE instance);  }### Answer:
@Test public void givenSinglePaddingCharacterAndMinimumLengthWhenGenerateThenReturnsExpectedString() { mCut = new PaddedFieldDataProvider<>(3, "0", mFieldDataProvider); given(mFieldDataProvider.generate(mInstance)).willReturn("7"); String result = mCut.generate(mInstance); assertEquals("007", result); }
@Test public void givenPaddingStringAndMinimumLengthWhenGenerateThenReturnsExpectedString() { mCut = new PaddedFieldDataProvider<>(3, "000", mFieldDataProvider); given(mFieldDataProvider.generate(mInstance)).willReturn("7"); String result = mCut.generate(mInstance); assertEquals("007", result); }
@Test public void givenStringAsLongAsPaddingWhenGenerateThenReturnsUnmodifiedString() { mCut = new PaddedFieldDataProvider<>(3, "000", mFieldDataProvider); given(mFieldDataProvider.generate(mInstance)).willReturn("123"); String result = mCut.generate(mInstance); assertEquals("123", result); }
@Test public void givenStringLongerThanPaddingWhenGenerateThenReturnsUnmodifiedString() { mCut = new PaddedFieldDataProvider<>(3, "000", mFieldDataProvider); given(mFieldDataProvider.generate(mInstance)).willReturn("1337"); String result = mCut.generate(mInstance); assertEquals("1337", result); }