Generics null check and ICollection added

null check for GetTypeWithGenericsInterfaceOf(typeof(IEnumerable<>)
and make ICollection behave the same as IEnumerable