// check if the activity or the retrieved event is changed since the
// last synchronization
AgentData agentData = getAgentData(agent);
boolean activityChanged = !equalsDateTime(agentData.activityUpdated,
activity.withStatus().getUpdated());
boolean eventChanged = !equalsDateTime(agentData.eventUpdated,
eventActivity.withStatus().getUpdated());
boolean changed = activityChanged || eventChanged;
if (changed && activity.isNewerThan(eventActivity)) {
// activity is updated (event is out-dated or not yet existing)