* Determine child entities with no dependency to an outside entity.
*
* @return the entities to remove
*/
protected Set<AbstractFamixEntity> getEntitiesToRemove() {
AbstractFamixEntity entity = getGraphLoader().getGraph().getFamixEntity(fSelectedNode);
List<AbstractFamixEntity> descendants = getGraphLoader().getSnapshotAnalyzer().getDescendants(entity);
descendants.remove(entity);
List<FamixAssociation> associationsToOtherEntities = getGraphLoader().getSnapshotAnalyzer().queryAssociationsOfEntities(descendants, null, "from");
associationsToOtherEntities.addAll(getGraphLoader().getSnapshotAnalyzer().queryAssociationsOfEntities(descendants, null, "to"));
Set<AbstractFamixEntity> entitiesToRemove = new HashSet<AbstractFamixEntity>(descendants);
for (FamixAssociation association : associationsToOtherEntities) {
Edge edge = getGraphLoader().getGraph().getEdge(association);
if (edge != null) {
AbstractFamixEntity from = association.getFrom();
AbstractFamixEntity to = association.getTo();
if (descendants.contains(from) && getGraphLoader().getGraph().contains(to)) {
entitiesToRemove.remove(from);
entitiesToRemove.removeAll(getGraphLoader().getSnapshotAnalyzer().getParentEntities(from));
} else if (descendants.contains(to) && getGraphLoader().getGraph().contains(from)) {
entitiesToRemove.remove(to);