Utils to work with generics.