### Question:
Partner { public static synchronized Partner get(Context context) { if (!searched) { PackageManager pm = context.getPackageManager(); final Intent intent = new Intent(ACTION_PARTNER_CUSTOMIZATION); List<ResolveInfo> receivers; if (VERSION.SDK_INT >= VERSION_CODES.N) { receivers = pm.queryBroadcastReceivers( intent, PackageManager.MATCH_SYSTEM_ONLY | PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE); } else { receivers = pm.queryBroadcastReceivers(intent, 0); } for (ResolveInfo info : receivers) { if (info.activityInfo == null) { continue; } final ApplicationInfo appInfo = info.activityInfo.applicationInfo; if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { try { final Resources res = pm.getResourcesForApplication(appInfo); partner = new Partner(appInfo.packageName, res); break; } catch (NameNotFoundException e) { Log.w(TAG, "Failed to find resources for " + appInfo.packageName); } } } searched = true; } return partner; } private  Partner(String packageName, Resources res); static Drawable getDrawable(Context context, @DrawableRes int id); static String getString(Context context, @StringRes int id); static int getColor(Context context, @ColorRes int id); static CharSequence getText(Context context, @StringRes int id); static ResourceEntry getResourceEntry(Context context, @AnyRes int id); static synchronized Partner get(Context context); @VisibleForTesting static synchronized void resetForTesting(); String getPackageName(); Resources getResources(); int getIdentifier(String name, String defType);  }### Answer:
@Test public void get_noPartnerPackage_shouldReturnNull() { Partner partner = Partner.get(application); assertThat(partner).isNull(); }
@Test public void get_nonSystemPartnerPackage_shouldIgnoreAndReturnNull() { new PartnerPackageBuilder("foo.bar") .setIsSystem(false) .setDirectBootAware(true) .injectResources(); new PartnerPackageBuilder("test.partner.package") .setIsSystem(false) .setDirectBootAware(true) .injectResources(); Partner partner = Partner.get(application); assertThat(partner).isNull(); }