### Question:
MetricStatSerDe { public static String serialize(List<MetricStat> metricStats) { try { return mapper.writeValueAsString(new MetricStatHolder(metricStats)); } catch (JsonProcessingException ex) { throw new RuntimeException(ex); } } private  MetricStatSerDe(); static String serialize(List<MetricStat> metricStats); static List<MetricStat> deserialize(String serializedMetricStats);  }### Answer:
@Test public void serializeTest() { String schema = "schema"; String table = "table"; Integer period = 60; String statistic = "p90"; String metricName = "metricName"; String namespace = "namespace"; List<Dimension> dimensions = new ArrayList<>(); dimensions.add(new Dimension().withName("dim_name1").withValue("dim_value1")); dimensions.add(new Dimension().withName("dim_name2").withValue("dim_value2")); List<MetricStat> metricStats = new ArrayList<>(); metricStats.add(new MetricStat() .withMetric(new Metric() .withNamespace(namespace) .withMetricName(metricName) .withDimensions(dimensions)) .withPeriod(60) .withStat(statistic)); String actualSerialization = MetricStatSerDe.serialize(metricStats); logger.info("serializeTest: {}", actualSerialization); List<MetricStat> actual = MetricStatSerDe.deserialize(actualSerialization); assertEquals(EXPECTED_SERIALIZATION, actualSerialization); assertEquals(metricStats, actual); }