static DateValue nextWeekStart(DateValue d, Weekday wkst) {
DTBuilder builder = new DTBuilder(d);
builder.day += (7 - ((7 + (Weekday.valueOf(d).javaDayNum
- wkst.javaDayNum)) % 7))
% 7;
return builder.toDate();
}
/** returns a sorted unique copy of ints. */
static int[] uniquify(int[] ints) {
return uniquify(ints, 0, ints.length);