### Question:
EasyPermissions { public static boolean hasPermissions(@NonNull Context context, @Size(min = 1) @NonNull String... perms) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { Log.w(TAG, "hasPermissions: API version < M, returning true by default"); return true; } if (context == null) { throw new IllegalArgumentException("Can't check permissions for null context"); } for (String perm : perms) { if (ContextCompat.checkSelfPermission(context, perm) != PackageManager.PERMISSION_GRANTED) { return false; } } return true; }  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(
            @NonNull android.app.Fragment host, @NonNull String rationale,
            int requestCode, @Size(min = 1) @NonNull String... perms); @Deprecated static void requestPermissions(
            @NonNull Activity host, @NonNull String rationale,
            @StringRes int positiveButton, @StringRes int negativeButton,
            int requestCode, @Size(min = 1) @NonNull String... perms); @Deprecated static void requestPermissions(
            @NonNull Fragment host, @NonNull String rationale,
            @StringRes int positiveButton, @StringRes int negativeButton,
            int requestCode, @Size(min = 1) @NonNull String... perms); @Deprecated static void requestPermissions(
            @NonNull android.app.Fragment host, @NonNull String rationale,
            @StringRes int positiveButton, @StringRes int negativeButton,
            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 somePermissionPermanentlyDenied(@NonNull android.app.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 permissionPermanentlyDenied(@NonNull android.app.Fragment host,
                                                      @NonNull String deniedPermission); static boolean somePermissionDenied(@NonNull Activity host,
                                               @NonNull String... perms); static boolean somePermissionDenied(@NonNull Fragment host,
                                               @NonNull String... perms); static boolean somePermissionDenied(@NonNull android.app.Fragment host,
                                               @NonNull String... perms);  }### Answer:
@Test public void testHasPermissions() { Application app = RuntimeEnvironment.application; String[] perms = new String[]{ Manifest.permission.READ_SMS, Manifest.permission.ACCESS_FINE_LOCATION }; assertFalse(EasyPermissions.hasPermissions(app, perms)); ShadowApplication.getInstance().grantPermissions(perms[0]); assertFalse(EasyPermissions.hasPermissions(app, perms)); ShadowApplication.getInstance().grantPermissions(perms); assertTrue(EasyPermissions.hasPermissions(app, perms)); }