### Question:
OtlpGrpcSpanExporter implements SpanExporter { @Override public CompletableResultCode export(Collection<SpanData> spans) { ExportTraceServiceRequest exportTraceServiceRequest = ExportTraceServiceRequest.newBuilder() .addAllResourceSpans(SpanAdapter.toProtoResourceSpans(spans)) .build(); final CompletableResultCode result = new CompletableResultCode(); TraceServiceFutureStub exporter; if (deadlineMs > 0) { exporter = traceService.withDeadlineAfter(deadlineMs, TimeUnit.MILLISECONDS); } else { exporter = traceService; } Futures.addCallback( exporter.export(exportTraceServiceRequest), new FutureCallback<ExportTraceServiceResponse>() { @Override public void onSuccess(@Nullable ExportTraceServiceResponse response) { result.succeed(); } @Override public void onFailure(Throwable t) { logger.log(Level.WARNING, "Failed to export spans", t); result.fail(); } }, MoreExecutors.directExecutor()); return result; } private  OtlpGrpcSpanExporter(ManagedChannel channel, long deadlineMs); @Override CompletableResultCode export(Collection<SpanData> spans); @Override CompletableResultCode flush(); static Builder newBuilder(); static OtlpGrpcSpanExporter getDefault(); @Override CompletableResultCode shutdown(); static final String DEFAULT_ENDPOINT; static final long DEFAULT_DEADLINE_MS; }### Answer:
@Test void testExport() { SpanData span = generateFakeSpan(); OtlpGrpcSpanExporter exporter = OtlpGrpcSpanExporter.newBuilder().setChannel(inProcessChannel).build(); try { assertThat(exporter.export(Collections.singletonList(span)).isSuccess()).isTrue(); assertThat(fakeCollector.getReceivedSpans()) .isEqualTo(SpanAdapter.toProtoResourceSpans(Collections.singletonList(span))); } finally { exporter.shutdown(); } }