}
@SuppressWarnings({ "rawtypes" })
@Override
public void execute(RuleMatch match, RuleElement element, RutaStream stream, InferenceCrowd crowd) {
RutaBlock parent = element.getParent();
List list = parent.getEnvironment().getVariableValue(var, List.class);
List<Object> toRemove = new ArrayList<Object>();
for (Object entry : list) {
Object value1 = getValue(entry, parent, stream);
for (IRutaExpression arg : elements) {
if (arg instanceof ListExpression) {
ListExpression l = (ListExpression) arg;
List list2 = l.getList(parent, stream);
for (Object object : list2) {
Object value2 = getValue(object, parent, stream);
if (value1.equals(value2)) {
toRemove.add(entry);
}
}
} else {
Object value2 = getValue(arg, parent, stream);
if (value1.equals(value2)) {
toRemove.add(entry);
}
}
}
}
for (Object object : toRemove) {
list.remove(object);
}
parent.getEnvironment().setVariableValue(var, list);
}