Strings { static Gen<String> ofBoundedLengthStrings(int minCodePoint, int maxCodePoint, int minLength, int maxLength) { return withCodePoints(minCodePoint, maxCodePoint, Generate.range(minLength, maxLength)) .map(reduceToSize(maxLength)); }    }
@Test public void shouldReturnEmptyStringIfFixedLengthSetToZero() { Gen<String> testee = Strings.ofBoundedLengthStrings( BASIC_LATIN_FIRST_CODEPOINT, BASIC_LATIN_LAST_CODEPOINT, 0, 0); assertThatGenerator(testee).generatesAllOf(""); }
@Test public void shouldShrinkTowardsZeroLengthString() { Gen<String> testee = Strings.ofBoundedLengthStrings( BASIC_LATIN_FIRST_CODEPOINT, BASIC_LATIN_LAST_CODEPOINT, 0, 100); assertThatGenerator(testee).shrinksTowards(""); }