MeterBuilder { public static MeterId convertId(Meter.Id id, String name) { MeterId.MeterType type; switch (id.getType()) { case COUNTER: type = MeterId.MeterType.COUNTER; break; case GAUGE: type = MeterId.MeterType.GAUGE; break; default: type = MeterId.MeterType.HISTOGRAM; break; } final List<MeterId.Tag> tags = id.getTags().stream().map(t -> new MeterId.Tag(t.getKey(), t.getValue())).collect(Collectors.toList()); final MeterId meterId = new MeterId(name, type, tags); return meterId; }  static Counter buildCounter(MeterId meterId, SkywalkingConfig config); static Counter.Mode getCounterMode(MeterId meterId, SkywalkingConfig config); static Optional<Histogram> buildHistogram(MeterId meterId, boolean supportsAggregablePercentiles,
                                                     DistributionStatisticConfig distributionStatisticConfig,
                                                     boolean useNanoTime); static MeterId convertId(Meter.Id id, String name);  }
@Test public void testConvertId() { final List<MeterId.Tag> meterTags = Arrays.asList(new MeterId.Tag("k1", "v1")); final Meter.Id counterId = new Meter.Id("test", Tags.of("k1", "v1"), null, "test", Meter.Type.COUNTER); assertId(MeterBuilder.convertId(counterId, "test"), "test", MeterId.MeterType.COUNTER, meterTags); final Meter.Id gaugeId = new Meter.Id("test", Tags.of("k1", "v1"), null, "test", Meter.Type.GAUGE); assertId(MeterBuilder.convertId(gaugeId, "test"), "test", MeterId.MeterType.GAUGE, meterTags); final Meter.Id otherId = new Meter.Id("test", Tags.of("k1", "v1"), null, "test", Meter.Type.DISTRIBUTION_SUMMARY); assertId(MeterBuilder.convertId(otherId, "test"), "test", MeterId.MeterType.HISTOGRAM, meterTags); }