Convert test class to anonymous class