@Test public void shouldNotRemoveResolvedEntitiesForSimpleTopology() { setupSimpleTopology(); assertEntities(asSet(entityB, entityC, entityD), relationshipResolver.removeUnresolvedEntities(asSet(entityD, entityB, entityC))); assertEntities(asSet(entityA, entityB, entityC, entityD), relationshipResolver.removeUnresolvedEntities(asSet(entityA, entityD, entityB, entityC))); }
public List<Entity> removeUnresolvedEntities(Set<Entity> entities) { List<Entity> resolvedEntities = new ArrayList<>(); EntitiesRetriever entitiesRetriever = new EntitiesRetriever(entities); for (Entity entity : entities) { if (isEntityResolved(entity, new ArrayList<>(), new ArrayList<>(), entitiesRetriever)) { resolvedEntities.add(entity); } } return resolvedEntities; }
RelationshipResolver { public List<Entity> removeUnresolvedEntities(Set<Entity> entities) { List<Entity> resolvedEntities = new ArrayList<>(); EntitiesRetriever entitiesRetriever = new EntitiesRetriever(entities); for (Entity entity : entities) { if (isEntityResolved(entity, new ArrayList<>(), new ArrayList<>(), entitiesRetriever)) { resolvedEntities.add(entity); } } return resolvedEntities; } }
RelationshipResolver { public List<Entity> removeUnresolvedEntities(Set<Entity> entities) { List<Entity> resolvedEntities = new ArrayList<>(); EntitiesRetriever entitiesRetriever = new EntitiesRetriever(entities); for (Entity entity : entities) { if (isEntityResolved(entity, new ArrayList<>(), new ArrayList<>(), entitiesRetriever)) { resolvedEntities.add(entity); } } return resolvedEntities; }  }
RelationshipResolver { public List<Entity> removeUnresolvedEntities(Set<Entity> entities) { List<Entity> resolvedEntities = new ArrayList<>(); EntitiesRetriever entitiesRetriever = new EntitiesRetriever(entities); for (Entity entity : entities) { if (isEntityResolved(entity, new ArrayList<>(), new ArrayList<>(), entitiesRetriever)) { resolvedEntities.add(entity); } } return resolvedEntities; }  List<Entity> removeUnresolvedEntities(Set<Entity> entities); @Autowired void setAllEntities(AllEntities allEntities); }
RelationshipResolver { public List<Entity> removeUnresolvedEntities(Set<Entity> entities) { List<Entity> resolvedEntities = new ArrayList<>(); EntitiesRetriever entitiesRetriever = new EntitiesRetriever(entities); for (Entity entity : entities) { if (isEntityResolved(entity, new ArrayList<>(), new ArrayList<>(), entitiesRetriever)) { resolvedEntities.add(entity); } } return resolvedEntities; }  List<Entity> removeUnresolvedEntities(Set<Entity> entities); @Autowired void setAllEntities(AllEntities allEntities);  }