generics tricks