public static final boolean isCloudProviderAvailable(Context context) {

    PackageManager pm = context.getPackageManager();
    try {
      pm.getPackageInfo(CloudContract.APP_PACKAGE_NAME, PackageManager.GET_ACTIVITIES);
      return true;
    } catch (PackageManager.NameNotFoundException e) {
      return false;
    }
  }
@Test
  public void testIsCloudProviderAvailable() {
    assertFalse(
        CloudSheetFragment.isCloudProviderAvailable(ApplicationProvider.getApplicationContext()));

    PackageInfo pi = new PackageInfo();
    pi.packageName = CloudContract.APP_PACKAGE_NAME;
    shadowOf(ApplicationProvider.getApplicationContext().getPackageManager()).installPackage(pi);

    assertTrue(
        CloudSheetFragment.isCloudProviderAvailable(ApplicationProvider.getApplicationContext()));
  }