Add getType implementation and test.