added test for visitor pattern