String end = activity.withStatus().getEnd();
if (start != null && end != null) {
DateTime startTime = new DateTime(start);
DateTime endTime = new DateTime(end);
Interval interval = new Interval(startTime, endTime);
if (interval.toDurationMillis() != duration) {
logger.info("status did not match constraints. "
+ "Changed end time to match the duration of "
+ duration + " ms");
// duration does not match. adjust the end time