EasyPermissions { public static boolean somePermissionPermanentlyDenied(@NonNull Activity host, @NonNull List<String> deniedPermissions) { return PermissionHelper.newInstance(host) .somePermissionPermanentlyDenied(deniedPermissions); }  static boolean hasPermissions(@NonNull Context context,
                                         @Size(min = 1) @NonNull String... perms); static void requestPermissions(
            @NonNull Activity host, @NonNull String rationale,
            int requestCode, @Size(min = 1) @NonNull String... perms); static void requestPermissions(
            @NonNull Fragment host, @NonNull String rationale,
            int requestCode, @Size(min = 1) @NonNull String... perms); static void requestPermissions(PermissionRequest request); static void onRequestPermissionsResult(int requestCode,
                                                  @NonNull String[] permissions,
                                                  @NonNull int[] grantResults,
                                                  @NonNull Object... receivers); static boolean somePermissionPermanentlyDenied(@NonNull Activity host,
                                                          @NonNull List<String> deniedPermissions); static boolean somePermissionPermanentlyDenied(@NonNull Fragment host,
                                                          @NonNull List<String> deniedPermissions); static boolean permissionPermanentlyDenied(@NonNull Activity host,
                                                      @NonNull String deniedPermission); static boolean permissionPermanentlyDenied(@NonNull Fragment host,
                                                      @NonNull String deniedPermission); static boolean somePermissionDenied(@NonNull Activity host,
                                               @NonNull String... perms); static boolean somePermissionDenied(@NonNull Fragment host,
                                               @NonNull String... perms);  }
@Test public void shouldHaveSomePermissionPermanentlyDenied_whenNotShowRationaleFromActivity() { showRationale(false, ALL_PERMS); assertThat(EasyPermissions.somePermissionPermanentlyDenied(spyActivity, Arrays.asList(ALL_PERMS))).isTrue(); }
@Test public void shouldNotHaveSomePermissionPermanentlyDenied_whenShowRationaleFromActivity() { showRationale(true, ALL_PERMS); assertThat(EasyPermissions.somePermissionPermanentlyDenied(spyActivity, Arrays.asList(ALL_PERMS))).isFalse(); }
@Test public void shouldHaveSomePermissionPermanentlyDenied_whenNotShowRationaleFromAppCompatActivity() { showRationale(false, ALL_PERMS); assertThat(EasyPermissions.somePermissionPermanentlyDenied(spyAppCompatActivity, Arrays.asList(ALL_PERMS))).isTrue(); }
@Test public void shouldNotHaveSomePermissionPermanentlyDenied_whenShowRationaleFromAppCompatActivity() { showRationale(true, ALL_PERMS); assertThat(EasyPermissions.somePermissionPermanentlyDenied(spyAppCompatActivity, Arrays.asList(ALL_PERMS))).isFalse(); }
@Test public void shouldHaveSomePermissionPermanentlyDenied_whenNotShowRationaleFromFragment() { showRationale(false, ALL_PERMS); assertThat(EasyPermissions.somePermissionPermanentlyDenied(spyFragment, Arrays.asList(ALL_PERMS))).isTrue(); }
@Test public void shouldNotHaveSomePermissionPermanentlyDenied_whenShowRationaleFromFragment() { showRationale(true, ALL_PERMS); assertThat(EasyPermissions.somePermissionPermanentlyDenied(spyFragment, Arrays.asList(ALL_PERMS))).isFalse(); }