programming to an interface
Declaring variables and parameters with interface types, naming a class only in new.
Using the most general interface offering what the code needs as the declared type, so other implementations can be substituted without edits.
See also