diff --git a/src/com/android/settings/accessibility/HearingAidDialogFragment.java b/src/com/android/settings/accessibility/HearingAidDialogFragment.java
index 63633d8..107c56d 100644
--- a/src/com/android/settings/accessibility/HearingAidDialogFragment.java
+++ b/src/com/android/settings/accessibility/HearingAidDialogFragment.java
@@ -18,7 +18,6 @@
 
 import android.app.Dialog;
 import android.app.settings.SettingsEnums;
-import android.content.DialogInterface;
 import android.os.Bundle;
 
 import androidx.appcompat.app.AlertDialog;
@@ -30,24 +29,17 @@
 
 public class HearingAidDialogFragment extends InstrumentedDialogFragment {
     public static HearingAidDialogFragment newInstance() {
-        HearingAidDialogFragment frag = new HearingAidDialogFragment();
-        return frag;
+        return new HearingAidDialogFragment();
     }
 
     @Override
     public Dialog onCreateDialog(Bundle savedInstanceState) {
         return new AlertDialog.Builder(getActivity())
+                .setTitle(R.string.accessibility_hearingaid_pair_instructions_title)
                 .setMessage(R.string.accessibility_hearingaid_pair_instructions_message)
                 .setPositiveButton(R.string.accessibility_hearingaid_instruction_continue_button,
-                        new DialogInterface.OnClickListener() {
-                            public void onClick(DialogInterface dialog, int which) {
-                                launchBluetoothAddDeviceSetting();
-                            }
-                        })
-                .setNegativeButton(android.R.string.cancel,
-                        new DialogInterface.OnClickListener() {
-                            public void onClick(DialogInterface dialog, int which) { }
-                        })
+                        (dialog, which) -> launchBluetoothAddDeviceSetting())
+                .setNegativeButton(android.R.string.cancel, /* listener= */ null)
                 .create();
     }
 
diff --git a/tests/robotests/src/com/android/settings/accessibility/HearingAidDialogFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/HearingAidDialogFragmentTest.java
new file mode 100644
index 0000000..4f8713a
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/accessibility/HearingAidDialogFragmentTest.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.accessibility;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+import static org.robolectric.Shadows.shadowOf;
+
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.fragment.app.FragmentActivity;
+
+import com.android.settings.SettingsActivity;
+import com.android.settings.bluetooth.BluetoothPairingDetail;
+import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+import org.robolectric.Robolectric;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.Config;
+
+
+@RunWith(RobolectricTestRunner.class)
+@Config(shadows = ShadowAlertDialogCompat.class)
+public class HearingAidDialogFragmentTest {
+
+    @Rule
+    public MockitoRule mocks = MockitoJUnit.rule();
+
+    private FragmentActivity mActivity;
+    private HearingAidDialogFragment mFragment;
+
+    @Before
+    public void setUpTestFragment() {
+        mFragment = spy(HearingAidDialogFragment.newInstance());
+        mActivity = Robolectric.setupActivity(FragmentActivity.class);
+        when(mFragment.getActivity()).thenReturn(mActivity);
+    }
+
+    @Test
+    public void onCreateDialog_dialogExist() {
+        final Dialog dialog = mFragment.onCreateDialog(Bundle.EMPTY);
+
+        assertThat(dialog).isNotNull();
+    }
+
+    @Test
+    public void dialogPositiveButtonClick_intentToExpectedClass() {
+        final AlertDialog dialog = (AlertDialog) mFragment.onCreateDialog(Bundle.EMPTY);
+        dialog.show();
+
+        dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();
+
+        final Intent intent = shadowOf(mActivity).getNextStartedActivity();
+        assertThat(intent.getStringExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT))
+                .isEqualTo(BluetoothPairingDetail.class.getName());
+    }
+
+    @Test
+    public void dialogNegativeButtonClick_dismissDialog() {
+        final AlertDialog dialog = (AlertDialog) mFragment.onCreateDialog(Bundle.EMPTY);
+        dialog.show();
+
+        dialog.getButton(DialogInterface.BUTTON_NEGATIVE).performClick();
+
+        assertThat(dialog.isShowing()).isFalse();
+    }
+}
