final TypedQuery<AcademicTermDetailImpl> query = this.createCachedQuery(this.findAllAcademicTermDetailsQuery);
final Set<AcademicTermDetailImpl> existingAcademicTermDetails = new HashSet<AcademicTermDetailImpl>(query.getResultList());
for (final Iterator<AcademicTermDetail> newAcademicTermDetailsItr = newAcademicTermDetails.iterator(); newAcademicTermDetailsItr.hasNext();) {
final AcademicTermDetail academicTermDetail = newAcademicTermDetailsItr.next();
//If ATD exists in both new and existing remove it from both
if (existingAcademicTermDetails.remove(academicTermDetail)) {
newAcademicTermDetailsItr.remove();
}