public static void Main()
Console.WriteLine(IsBoxed((ValueType)42));
Console.WriteLine(IsBoxed(42));
Console.WriteLine(IsBoxed((object)42));
Console.WriteLine(IsBoxed((IComparable)42));
public static bool IsBoxed<T>(T value)
(typeof(T).IsInterface || typeof(T) == typeof(object)) &&
value.GetType().IsValueType && !typeof(T).IsValueType ;