Generifying stats service and test case