blob: 61f45f16f61b22d88e03e8d9d6700a67a39a2de5 [file] [log] [blame]
package org.testng.v6;
import java.util.List;
import java.util.Set;
public class AfterOperationSet {
private Set<Operation> m_afterOperations = Sets.newHashSet();
public void add(Operation operation) {
m_afterOperations.add(operation);
}
public List<Operation> getOperationsThatMustRunAfter(Integer id) {
List<Operation> result = Lists.newArrayList();
List<Operation> toRemove = Lists.newArrayList();
for (Operation o : m_afterOperations) {
for (int n : o.getAfter()) {
if (n == id) {
result.add(o);
toRemove.add(o);
}
}
}
for (Operation o : toRemove) {
m_afterOperations.remove(o);
}
return result;
}
}