@Test void isSystemPackageTrueNested() { Package rootPackage_ = mock(Package.class); when(rootPackage_.getId()).thenReturn(PACKAGE_SYSTEM); Package package_ = mock(Package.class); when(package_.getId()).thenReturn("systemChild"); when(package_.getRootPackage()).thenReturn(rootPackage_); assertTrue(PackageUtils.isSystemPackage(package_)); }
public static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage) { if (aPackage == null) { return false; } return runAsSystem( () -> aPackage.getId().equals(PACKAGE_SYSTEM) || (aPackage.getRootPackage() != null && aPackage.getRootPackage().getId().equals(PACKAGE_SYSTEM))); }
PackageUtils { public static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage) { if (aPackage == null) { return false; } return runAsSystem( () -> aPackage.getId().equals(PACKAGE_SYSTEM) || (aPackage.getRootPackage() != null && aPackage.getRootPackage().getId().equals(PACKAGE_SYSTEM))); } }
PackageUtils { public static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage) { if (aPackage == null) { return false; } return runAsSystem( () -> aPackage.getId().equals(PACKAGE_SYSTEM) || (aPackage.getRootPackage() != null && aPackage.getRootPackage().getId().equals(PACKAGE_SYSTEM))); } private  PackageUtils(); }
PackageUtils { public static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage) { if (aPackage == null) { return false; } return runAsSystem( () -> aPackage.getId().equals(PACKAGE_SYSTEM) || (aPackage.getRootPackage() != null && aPackage.getRootPackage().getId().equals(PACKAGE_SYSTEM))); } private  PackageUtils(); static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage); static boolean contains(Package pack, Package wantedPackage); }
PackageUtils { public static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage) { if (aPackage == null) { return false; } return runAsSystem( () -> aPackage.getId().equals(PACKAGE_SYSTEM) || (aPackage.getRootPackage() != null && aPackage.getRootPackage().getId().equals(PACKAGE_SYSTEM))); } private  PackageUtils(); static boolean isSystemPackage(@Nullable @CheckForNull Package aPackage); static boolean contains(Package pack, Package wantedPackage);  }