lastIteration.addAll(closure);
while(!lastIteration.isEmpty()){
final SetImplementation<Bindings> thisIteration = new SetImplementation<Bindings>();
final Iterator<Bindings> itsubject = lastIteration.iterator();
while (itsubject.hasNext()){
final Bindings closureElement = itsubject.next();
if(this.allowedSubjects==null || this.allowedSubjects.contains(closureElement.get(this.subject))){
Set<Literal> potentialNewBindings = reachabilityMap.get(closureElement.get(this.object));
if (potentialNewBindings != null){
final SetImplementation<Literal> updatedMapEntry= new SetImplementation<Literal>(reachabilityMap.get(closureElement.get(this.subject)));
final Iterator<Literal> itobject = potentialNewBindings.iterator();
while(itobject.hasNext()){
final Literal tempObject = itobject.next();
final Bindings newBind = new BindingsCollection();
newBind.add(this.subject, closureElement.get(this.subject));
newBind.add(this.object, tempObject);
if(closure.add(newBind)){
thisIteration.add(newBind);
updatedMapEntry.add(tempObject);
}
}