### Question:
MetricAdapter { static Collection<DoubleDataPoint> toDoubleDataPoints(Collection<Point> points) { List<DoubleDataPoint> result = new ArrayList<>(points.size()); for (Point point : points) { DoublePoint doublePoint = (DoublePoint) point; DoubleDataPoint.Builder builder = DoubleDataPoint.newBuilder() .setStartTimeUnixNano(doublePoint.getStartEpochNanos()) .setTimeUnixNano(doublePoint.getEpochNanos()) .setValue(doublePoint.getValue()); Collection<StringKeyValue> labels = toProtoLabels(doublePoint.getLabels()); if (!labels.isEmpty()) { builder.addAllLabels(labels); } result.add(builder.build()); } return result; } private  MetricAdapter();   }### Answer:
@Test void toDoubleDataPoints() { assertThat(MetricAdapter.toDoubleDataPoints(Collections.emptyList())).isEmpty(); assertThat( MetricAdapter.toDoubleDataPoints( singletonList(MetricData.DoublePoint.create(123, 456, Labels.of("k", "v"), 5.1)))) .containsExactly( DoubleDataPoint.newBuilder() .setStartTimeUnixNano(123) .setTimeUnixNano(456) .addAllLabels( singletonList(StringKeyValue.newBuilder().setKey("k").setValue("v").build())) .setValue(5.1) .build()); assertThat( MetricAdapter.toDoubleDataPoints( ImmutableList.of( MetricData.DoublePoint.create(123, 456, Labels.empty(), 5.1), MetricData.DoublePoint.create(321, 654, Labels.of("k", "v"), 7.1)))) .containsExactly( DoubleDataPoint.newBuilder() .setStartTimeUnixNano(123) .setTimeUnixNano(456) .setValue(5.1) .build(), DoubleDataPoint.newBuilder() .setStartTimeUnixNano(321) .setTimeUnixNano(654) .addAllLabels( singletonList(StringKeyValue.newBuilder().setKey("k").setValue("v").build())) .setValue(7.1) .build()); }