Every X years in @YearRange
derTobsch opened this issue · comments
Tobias Schneider commented
Testing Problem
I want to get every fifth year from 1945 until 1989 (@YearRange(min = 1945, max = 1989)
). So the output should be 1945, 1950, 1955, 1960, ... until 1985.
Is there a way to achieve this?
Johannes Link commented
Not with annotations but using something like:
@Provide
Arbitrary<Year> everyFifthYear() {
return Dates.years().between(1945, 1989)
.filter( year -> year.getValue() % 5 == 0);
}
should do it.