Use power of Generics to infer types