public void setErrorDialog(final Dialog errorDialog) {
    this.errorDialog = errorDialog;
  }
@Test
  public void setErrorDialog() {
    final ShadowGoogleApiAvailability shadowGoogleApiAvailability =
        Shadows.shadowOf(GoogleApiAvailability.getInstance());
    final Dialog expectedDialog = mock(Dialog.class);
    final Activity mockActivity = mock(Activity.class);
    final int mockErrorCode = ConnectionResult.API_UNAVAILABLE;
    final int mockRequestCode = 1234;
    shadowGoogleApiAvailability.setErrorDialog(expectedDialog);

    final Dialog actualDialog =
        GoogleApiAvailability.getInstance()
            .getErrorDialog(mockActivity, mockErrorCode, mockRequestCode);

    assertThat(actualDialog).isEqualTo(expectedDialog);
  }