add sample for class and subclass.