PermissionStatusChecker { @NonNull public Single<Boolean> isPermissionGranted(@NonNull String manifestPermission) { return Single.just(ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED); } @Inject  PermissionStatusChecker(@NonNull Context context); @NonNull Single<Boolean> isPermissionGranted(@NonNull String manifestPermission);  }
@Test @SuppressWarnings("all") public void isPermissionGranted() throws Exception { final String permission = "permission"; final Single<Boolean> result = permissionStatusChecker.isPermissionGranted(permission); verify(context).checkPermission(eq(permission), anyInt(), anyInt()); }