Date now = new Date();
Date prev = new Date(now.getTime() - 1L);
Date start = new Date(now.getTime() - 2L);
Date end = new Date(now.getTime() + 2L);
SpinnerDateModel m = new SpinnerDateModel(now, start, end,
Calendar.MILLISECOND);
harness.check(m.getValue(), now);
harness.check(m.getPreviousValue(), prev);
// accessing the previous value doesn't update the current value
harness.check(m.getValue(), now);
m.setValue(prev);
harness.check(m.getPreviousValue(), start);
m.setValue(start);
harness.check(m.getPreviousValue(), null);
// repeat for model without bounds
m = new SpinnerDateModel(now, null, null, Calendar.MILLISECOND);
harness.check(m.getValue(), now);
harness.check(m.getPreviousValue(), prev);
// accessing the previous value doesn't update the current value
harness.check(m.getValue(), now);
}