Specialization object: a subclass of the target that overrides the creation method to return a mock instead of a collaborator.
If a subclass of one of these classes needed to override the default behavior, it could do so by overriding the method.
Mock object: a subclass (or implementation) of the collaborator that follows the mock object pattern.
This is one approach that enables the client to determine what member of the class hierarchy it receives, and process the additional information in the subclass accordingly.
If fields make sense for one subclass but not the other, you can remove them from the superclass and push them down into the subclass they belong to.
If this is the progenitor of these rare subclass of supernova, we expect to be finding these exotic pairs at the same frequency as the supernova.
You create your subclass and override just those methods that you use in your methods under test.
Create a mock object class as a subclass of the concrete class.
You can then customize how each class can be administered by adding class attributes to this subclass.
Reducing coupling between a subclass and its superclasses.
a subclass of Sporozoa.