### Question:
MetricAdapter { static List<DoubleHistogramDataPoint> toSummaryDataPoints(Collection<Point> points) { List<DoubleHistogramDataPoint> result = new ArrayList<>(points.size()); for (Point point : points) { SummaryPoint summaryPoint = (SummaryPoint) point; DoubleHistogramDataPoint.Builder builder = DoubleHistogramDataPoint.newBuilder() .setStartTimeUnixNano(summaryPoint.getStartEpochNanos()) .setTimeUnixNano(summaryPoint.getEpochNanos()) .setCount(summaryPoint.getCount()) .setSum(summaryPoint.getSum()); List<StringKeyValue> labels = toProtoLabels(summaryPoint.getLabels()); if (!labels.isEmpty()) { builder.addAllLabels(labels); } if (!summaryPoint.getPercentileValues().isEmpty()) { addBucketValues(summaryPoint.getPercentileValues(), builder); } result.add(builder.build()); } return result; } private  MetricAdapter();   }### Answer:
@Test void toSummaryDataPoints() { assertThat( MetricAdapter.toSummaryDataPoints( singletonList( MetricData.SummaryPoint.create( 123, 456, Labels.of("k", "v"), 5, 14.2, singletonList(MetricData.ValueAtPercentile.create(0.9, 1.1)))))) .containsExactly( DoubleHistogramDataPoint.newBuilder() .setStartTimeUnixNano(123) .setTimeUnixNano(456) .addAllLabels( singletonList(StringKeyValue.newBuilder().setKey("k").setValue("v").build())) .setCount(5) .setSum(14.2) .addBucketCounts(1) .addBucketCounts(0) .addExplicitBounds(0.9) .build()); assertThat( MetricAdapter.toSummaryDataPoints( ImmutableList.of( MetricData.SummaryPoint.create( 123, 456, Labels.empty(), 7, 15.3, Collections.emptyList()), MetricData.SummaryPoint.create( 321, 654, Labels.of("k", "v"), 9, 18.3, ImmutableList.of( MetricData.ValueAtPercentile.create(0.9, 1.1), MetricData.ValueAtPercentile.create(0.99, 20.3)))))) .containsExactly( DoubleHistogramDataPoint.newBuilder() .setStartTimeUnixNano(123) .setTimeUnixNano(456) .setCount(7) .setSum(15.3) .build(), DoubleHistogramDataPoint.newBuilder() .setStartTimeUnixNano(321) .setTimeUnixNano(654) .addAllLabels( singletonList(StringKeyValue.newBuilder().setKey("k").setValue("v").build())) .setCount(9) .setSum(18.3) .addBucketCounts(1) .addBucketCounts(20) .addBucketCounts(0) .addExplicitBounds(0.9) .addExplicitBounds(0.99) .build()); }