Strings { static Gen<String> withCodePoints(int minCodePoint, int maxCodePoint, Gen<Integer> numberOfCodePoints) { return Generate.intArrays(numberOfCodePoints , CodePoints.codePoints(minCodePoint, maxCodePoint)) .map(is -> new String(is, 0, is.length)); }    }
@Test public void shouldShrinkFixedCodepointStringsTowardsExclaimationMarks() { Gen<String> testee = Strings.withCodePoints( BASIC_LATIN_FIRST_CODEPOINT, BASIC_LATIN_LAST_CODEPOINT, Generate.constant(3)); assertThatGenerator(testee).shrinksTowards("!!!"); }