Add unit test for stack-related methods