@Test
    public void deserialize_serialize_roundtrip_with_metrics_packet() throws IOException {
        YamasJsonModel jsonModel = getYamasJsonModel("yamas-array.json");
        MetricsPacket metricsPacket = YamasJsonUtil.toMetricsPacketBuilder(jsonModel).build();

        // Do some sanity checking
        assertEquals(toServiceId("vespa.searchnode"), metricsPacket.service());
        assertTrue(metricsPacket.consumers().contains(toConsumerId("Vespa")));
        assertEquals(5.555555555E9, metricsPacket.metrics().get(toMetricId("memory_rss")).doubleValue(), 0.1d); //Not using custom double rendrer

        // Serialize and verify
        String string = YamasJsonUtil.toJson(List.of(metricsPacket), false);
        assertEquals(EXPECTED_JSON, string);
    }
Tests for YamasJsonModel and YamasArrayJsonModel

@author smorgrav
@author gjoranv
metrics-proxy/src/test/java/ai/vespa/metricsproxy/metric/model/json/YamasJsonModelTest.java