Fixed the tests to use anonymous classes

I fixed the tests to use anonymous classes so the class definitions wouldn't get overridden.