public Set<IEntity> getAllRequiredEntities(IEntity ent){
		
		// Find all associations and references made from ent
		Set<IEntity> output = new HashSet<IEntity>();
		output.add(getInheritedEntity(ent));

		for (Link link: getLinks()) {
			// TODO: move the logic to separate testers.
			if (link.getEntity1() == ent
					&& link.getType().getDecor1() == LinkDecor.ARROW) {
				output.add(link.getEntity2());
			} else if (link.getEntity2() == ent
					&& link.getType().getDecor2() == LinkDecor.ARROW) {
				output.add(link.getEntity1());
			}
			
			if (link.getEntity1() == ent
					&& link.getType().getDecor2() == LinkDecor.AGREGATION) {
				output.add(link.getEntity2());
			} else if (link.getEntity2() == ent
					&& link.getType().getDecor1() == LinkDecor.AGREGATION) {
				output.add(link.getEntity1());
			}
		}
		return output;
	}