@Test
public void throwsApiException() {

  Exception throwable =
      new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), false);
  try {
    ApiExceptions.callAndTranslateApiException(ApiFutures.immediateFailedFuture(throwable));
    Assert.fail("ApiExceptions should have thrown an exception");
  } catch (ApiException expected) {
    assertThat(expected).isSameInstanceAs(throwable);
  }
}