Parameterized helper functions.
Verify the order of pops.