### Question:
Partner { public static ResourceEntry getResourceEntry(Context context, @AnyRes int id) { final Partner partner = Partner.get(context); if (partner != null) { final Resources ourResources = context.getResources(); final String name = ourResources.getResourceEntryName(id); final String type = ourResources.getResourceTypeName(id); final int partnerId = partner.getIdentifier(name, type); if (partnerId != 0) { return new ResourceEntry(partner.mResources, partnerId, true); } } return new ResourceEntry(context.getResources(), id, false); } private  Partner(String packageName, Resources res); static Drawable getDrawable(Context context, @DrawableRes int id); static String getString(Context context, @StringRes 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 testLoadDefaultValue() { mPackageManager.addResolveInfoForIntent( new Intent(ACTION_PARTNER_CUSTOMIZATION), Arrays.asList( createResolveInfo("foo.bar", false, true), createResolveInfo("test.partner.package", true, true)) ); ResourceEntry entry = Partner.getResourceEntry(mContext, R.color.suw_color_accent_dark); int partnerValue = entry.resources.getColor(entry.id); assertEquals("Partner value should default to 0xff448aff", 0xff448aff, partnerValue); assertFalse("Partner value should come from fallback", entry.isOverlay); }
@Test public void testNotDirectBootAware() { mPackageManager.addResolveInfoForIntent( new Intent(ACTION_PARTNER_CUSTOMIZATION), Collections.singletonList(createResolveInfo("test.partner.package", true, false))); ResourceEntry entry = Partner.getResourceEntry(mContext, R.color.suw_color_accent_dark); int partnerValue = entry.resources.getColor(entry.id); assertEquals("Partner value should default to 0xff448aff", 0xff448aff, partnerValue); assertFalse("Partner value should come from fallback", entry.isOverlay); }