Added test for SingleMetric#toJson before refactoring