Is It Okay To Switch Out Eggs At The Supermarket?

Zachery says when he goes to buy a dozen eggs, he wants to make sure he’s not paying for any bad ones, so he opens the cartons and switches them out. He says a fellow shopper told him this was illegal. Obviously this fellow shopper is an idiot, but I thought I’d post Zachary’s question anyway just so readers can share their own supermarket QA methods.

Zachary writes:

My question is about the legality of switching (same) items in containers. When I go shopping I try to make every cent count, which means I switch out bad eggs in the carton for good ones. I’ve also been doing this with tomatoes lately. However, the last time I went shopping another customer pulled up beside me, and told me that what I was doing was illegal. He said that if I was caught by the store I’d have the police called on me. As far as I know everyone in my family has done this as long as they can remember. Is it really against the law to make sure you’re not getting any bad products in your carton?