1. A non-transitory, computer-readable storage medium storing program instructions that when executed on a computing device cause the computing device to perform: loading a class file comprising a class declaration for a generic class, wherein the generic class is specializable over a plurality of type parameterizations, wherein the class declaration comprises a refinement method specific to a particular one of the plurality of type parameterizations, wherein the refinement method comprises an alternate implementation for a method of the generic class when the generic class is specialized for the particular type parameterization; specializing the generic class for the particular type parameterization; and including the refinement method in the specialized generic class in response to said specializing and based on the particular type parameterization.