Conditional testing for stack