@Test
@SuppressWarnings("unchecked")
public void testSyncError() {

  RuntimeException expectedError = new RuntimeException("expected error");
  // Create a broken inner callable
  ServerStreamingCallable<String, String> innerCallable = mock(ServerStreamingCallable.class);
  doThrow(expectedError)
      .when(innerCallable)
      .call(
          eq("test"),
          (ResponseObserver<String>) any(ResponseObserver.class),
          any(ApiCallContext.class));
  // Recreate the tracedCallable using the new inner callable
  tracedCallable = new TracedServerStreamingCallable<>(innerCallable, tracerFactory, SPAN_NAME);
  try {
    tracedCallable.call("test", responseObserver, callContext);
  } catch (RuntimeException e) {
    // noop
  }
  verify(tracer, times(1)).operationFailed(expectedError);
}