Method replace for the ADT bag

Implement a method replace for the ADT bag that replaces and returns an unspecified object