Add allObjects method to Stack.