Extracted code used to find the type hierarchy for a given Type into a reusable class called TypeInspector.