code: public static boolean checkAggregateReferences(Application app) {
  		Map<DomainObject, Set<DomainObject>> aggregateGroups = getAggregateGroups(app);
  		for (Set<DomainObject> group1 : aggregateGroups.values()) {
  			for (Set<DomainObject> group2 : aggregateGroups.values()) {
  				if (group1 == group2) {
  					continue;
  				}
  				// find only the elements common to both sets, i.e. the
  				// intersection
  				Set<DomainObject> intersection = new HashSet<DomainObject>(
  						group1);
  				intersection.retainAll(group2);
  				if (!intersection.isEmpty()) {
  					// found two groups with some non-root objects in common,
  					// i.e. reference directly to a non-root from outside the
  					// aggregate boundary
  					LOG.warn("checkAggregateReferences failed with intersection: "
  							+ intersection);
  					return false;
  				}
  			}
  		}
  		// everything alright
  		return true;
  	}
docs: According to DDD the aggregate root is the only member of the aggregate
  that objects outside the aggregate boundary may hold references to.