The break;
statements are missing in the switch cases. This means that the code would continue to the next case, which in fact is not needed.
I'm pretty sure you can avoid the inner loop. You're checking every Item in mainList
with every Item in selectedList