@ParameterizedTest @ValueSource(strings = { "racecar", "radar", "able was I ere I saw elba" }) voidpalindromes(String candidate){ assertTrue(StringUtils.isPalindrome(candidate)); }
// Generates random positive integers between 0 and 100 until // a number evenly divisible by 7 is encountered. Iterator<Integer> inputGenerator = new Iterator<Integer>() {
Random random = new Random(); int current;
@Override publicbooleanhasNext(){ current = random.nextInt(100); return current % 7 != 0; }
@Override public Integer next(){ return current; } };