### Question:
MeterSdk implements Meter { Collection<MetricData> collectAll() { InstrumentRegistry instrumentRegistry = meterSharedState.getInstrumentRegistry(); Collection<AbstractInstrument> instruments = instrumentRegistry.getInstruments(); List<MetricData> result = new ArrayList<>(instruments.size()); for (AbstractInstrument instrument : instruments) { result.addAll(instrument.collectAll()); } return result; } MeterSdk(
      MeterProviderSharedState meterProviderSharedState,
      InstrumentationLibraryInfo instrumentationLibraryInfo,
      ViewRegistry viewRegistry); @Override DoubleCounterSdk.Builder doubleCounterBuilder(String name); @Override LongCounterSdk.Builder longCounterBuilder(String name); @Override DoubleUpDownCounterSdk.Builder doubleUpDownCounterBuilder(String name); @Override LongUpDownCounterSdk.Builder longUpDownCounterBuilder(String name); @Override DoubleValueRecorderSdk.Builder doubleValueRecorderBuilder(String name); @Override LongValueRecorderSdk.Builder longValueRecorderBuilder(String name); @Override DoubleSumObserverSdk.Builder doubleSumObserverBuilder(String name); @Override LongSumObserverSdk.Builder longSumObserverBuilder(String name); @Override DoubleUpDownSumObserverSdk.Builder doubleUpDownSumObserverBuilder(String name); @Override LongUpDownSumObserverSdk.Builder longUpDownSumObserverBuilder(String name); @Override DoubleValueObserverSdk.Builder doubleValueObserverBuilder(String name); @Override LongValueObserverSdk.Builder longValueObserverBuilder(String name); @Override BatchRecorderSdk newBatchRecorder(String... keyValuePairs);  }### Answer:
@Test void collectAll() { LongCounterSdk longCounter = testSdk.longCounterBuilder("testLongCounter").build(); longCounter.add(10, Labels.empty()); LongValueRecorderSdk longValueRecorder = testSdk.longValueRecorderBuilder("testLongValueRecorder").build(); longValueRecorder.record(10, Labels.empty()); DoubleCounterSdk doubleCounter = testSdk.doubleCounterBuilder("testDoubleCounter").build(); doubleCounter.add(10.1, Labels.empty()); DoubleValueRecorderSdk doubleValueRecorder = testSdk.doubleValueRecorderBuilder("testDoubleValueRecorder").build(); doubleValueRecorder.record(10.1, Labels.empty()); assertThat(testSdk.collectAll()) .containsExactlyInAnyOrder( MetricData.create( RESOURCE, INSTRUMENTATION_LIBRARY_INFO, "testLongCounter", "", "1", MetricData.Type.MONOTONIC_LONG, Collections.singletonList( LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10))), MetricData.create( RESOURCE, INSTRUMENTATION_LIBRARY_INFO, "testDoubleCounter", "", "1", MetricData.Type.MONOTONIC_DOUBLE, Collections.singletonList( DoublePoint.create(testClock.now(), testClock.now(), Labels.empty(), 10.1))), MetricData.create( RESOURCE, INSTRUMENTATION_LIBRARY_INFO, "testLongValueRecorder", "", "1", MetricData.Type.SUMMARY, Collections.singletonList( SummaryPoint.create( testClock.now(), testClock.now(), Labels.empty(), 1, 10, Arrays.asList( ValueAtPercentile.create(0, 10), ValueAtPercentile.create(100, 10))))), MetricData.create( RESOURCE, INSTRUMENTATION_LIBRARY_INFO, "testDoubleValueRecorder", "", "1", MetricData.Type.SUMMARY, Collections.singletonList( SummaryPoint.create( testClock.now(), testClock.now(), Labels.empty(), 1, 10.1d, Arrays.asList( ValueAtPercentile.create(0, 10.1d), ValueAtPercentile.create(100, 10.1d)))))); }