@Override
    public String asJson() {
        //use the static Gson to prevent frequent use of expensive java.lang.reflect calls
        String json = GSON_CONVERTER.toJson(this);

        // Adjust the JSON string to remove all breaklines between entries in the histogram array
        int startIndex = json.indexOf('[') + 1;
        int endIndex = json.indexOf(']');

        String histString = json.substring(startIndex, endIndex);
        String histStringWithoutBreaklines = histString.replace("\n   ", "").trim();

        return json.replace(histString, histStringWithoutBreaklines);
    }
@Test
    public void convertDailyMetricsToJson() {

        DailyMetrics dailyMetrics = testExampleAsObject();

        assertEquals(dailyMetrics.asJson(), testExampleAsJson());
    }