shadows/framework/src/main/java/org/robolectric/shadows/ShadowDevicePolicyManager.java
public void failSetApplicationHiddenFor(Collection<String> packagesToFail) {
    if (packagesToFail == null) {
      packagesToFail = Collections.emptySet();
    }
    packagesToFailForSetApplicationHidden = packagesToFail;
  }
public void failSetApplicationHiddenFor(Collection<String> packagesToFail) {
    if (packagesToFail == null) {
      packagesToFail = Collections.emptySet();
    }
    packagesToFailForSetApplicationHidden = packagesToFail;
  }
Set package names for witch {@link DevicePolicyManager#setApplicationHidden} should fail.

@param packagesToFail collection of package names or {@code null} to clear the packages.