in src/main/java/org/apache/sling/commons/testing/integration/NameValuePairList.java [73:90]
public void addOrReplace(String name, String value) {
boolean replaced = false;
for (ListIterator<NameValuePair> li = delegate.listIterator(); li.hasNext();) {
NameValuePair current = li.next();
if (current.getName().equals(name)) {
if (!replaced) {
current.setValue(value);
replaced = true;
} else {
li.remove();
}
}
}
if (!replaced) {
delegate.add(new NameValuePair(name, value));
}
}