Skip to content

Commit

Permalink
fixes for jqwik api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pfichtner committed Dec 4, 2024
1 parent 2105e0e commit 5662653
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,14 @@ public DurationSequence(Arbitrary<OffsetPos> base, Arbitrary<Long> between, Time

@Override
Arbitrary<List<OffsetPos>> build() {
return forDuration
.flatMap(minDuration -> base.collect(positions -> durationReached(positions, minDuration)));
return forDuration.flatMap(m -> base.collect(p -> durationReached(p, m)));
}

private boolean durationReached(List<OffsetPos> positions, long minDuration) {
private boolean durationReached(List<? extends OffsetPos> positions, long minDuration) {
return positions.size() > 1 && duration(positions.stream().limit(positions.size() - 1)) >= minDuration;
}

private long duration(Stream<OffsetPos> stream) {
private long duration(Stream<? extends OffsetPos> stream) {
return stream.mapToLong(OffsetPos::getOffset).sum();
}

Expand Down

0 comments on commit 5662653

Please sign in to comment.