### Question:
Span implements io.opentracing.Span { @Override public void finish() { finish(nowMicros()); } Span(AbstractTracer tracer, SpanContext context, Builder grpcSpan, long startTimestampRelativeNanos); @Override SpanContext context(); @Override void finish(); @Override void finish(long finishTimeMicros); @Override Span setTag(String key, String value); @Override Span setTag(String key, boolean value); @Override Span setTag(String key, Number value); @Override Span setTag(io.opentracing.tag.Tag<T> tag, T value); @Override synchronized String getBaggageItem(String key); @Override synchronized Span setBaggageItem(String key, String value); synchronized Span setOperationName(String operationName); Span setComponentName(String componentName); @SuppressWarnings("WeakerAccess") void close(); AbstractTracer getTracer(); final Span log(Map<String, ?> fields); @Override final Span log(long timestampMicros, Map<String, ?> fields); @Override Span log(String message); @Override Span log(long timestampMicroseconds, String message); @SuppressWarnings("WeakerAccess") String generateTraceURL(); @SuppressWarnings("WeakerAccess") Builder getGrpcSpan();  }### Answer:
@Test public void testFinish_withoutFinishTime() { assertEquals(0L, grpcSpan.getDurationMicros()); undertest.finish(); assertNotEquals(0L, grpcSpan.getDurationMicros()); verify(abstractTracer).addSpan(grpcSpan.build()); }
@Test public void testFinish_withFinishTime() { long finishTimeMicros = 123L; undertest.finish(finishTimeMicros); assertEquals(finishTimeMicros, grpcSpan.getDurationMicros()); verify(abstractTracer).addSpan(grpcSpan.build()); }