refactored test cases for stack using linked list