A method accumulates information from heterogeneous classes.
Move the accumulation task to a Visitor that can visit each class to accumulate the information.