static L moveItemsFirst(Cl itemsToMove, Cl l) {
if (empty(itemsToMove) || empty(l)) ret asList(l);
itemsToMove = asSet(itemsToMove);
var set = asSet(l);
L out = emptyList(l(l));
for (a : itemsToMove)
if (set.contains(a))
out.add(a);
for (A a : l)
if (!itemsToMove.contains(a))
out.add(a);
ret out;
}