how to check if a stack is empty java