program to a supertype