### Question:
WizardManagerHelper { public static boolean isLightTheme(Intent intent, boolean def) { final String theme = intent.getStringExtra(EXTRA_THEME); return isLightTheme(theme, def); }  static Intent getNextIntent(Intent originalIntent, int resultCode); static Intent getNextIntent(Intent originalIntent, int resultCode, Intent data); static void copyWizardManagerExtras(Intent srcIntent, Intent dstIntent); static boolean isSetupWizardIntent(Intent intent); static boolean isUserSetupComplete(Context context); static boolean isDeviceProvisioned(Context context); static boolean isDeferredSetupWizard(Intent originalIntent); static boolean isPreDeferredSetupWizard(Intent originalIntent); static boolean isLightTheme(Intent intent, boolean def); static boolean isLightTheme(String theme, boolean def); static @StyleRes int getThemeRes(Intent intent, @StyleRes int defaultTheme); static @StyleRes int getThemeRes(String theme, @StyleRes int defaultTheme); static final String EXTRA_THEME; static final String EXTRA_USE_IMMERSIVE_MODE; static final String SETTINGS_GLOBAL_DEVICE_PROVISIONED; static final String SETTINGS_SECURE_USER_SETUP_COMPLETE; static final String THEME_HOLO; static final String THEME_HOLO_LIGHT; static final String THEME_MATERIAL; static final String THEME_MATERIAL_LIGHT; static final String THEME_GLIF; static final String THEME_GLIF_LIGHT; static final String THEME_GLIF_V2; static final String THEME_GLIF_V2_LIGHT; static final String THEME_GLIF_V3; static final String THEME_GLIF_V3_LIGHT; }### Answer:
@Test public void isLightTheme_shouldReturnTrue_whenThemeIsLight() { List<String> lightThemes = Arrays.asList( "holo_light", "material_light", "glif_light", "glif_v2_light", "glif_v3_light" ); ArrayList<String> unexpectedIntentThemes = new ArrayList<>(); ArrayList<String> unexpectedStringThemes = new ArrayList<>(); for (final String theme : lightThemes) { Intent intent = new Intent(); intent.putExtra(WizardManagerHelper.EXTRA_THEME, theme); if (!WizardManagerHelper.isLightTheme(intent, false)) { unexpectedIntentThemes.add(theme); } if (!WizardManagerHelper.isLightTheme(theme, false)) { unexpectedStringThemes.add(theme); } } assertTrue("Intent themes " + unexpectedIntentThemes + " should be light", unexpectedIntentThemes.isEmpty()); assertTrue("String themes " + unexpectedStringThemes + " should be light", unexpectedStringThemes.isEmpty()); }
@Test public void isLightTheme_shouldReturnFalse_whenThemeIsNotLight() { List<String> lightThemes = Arrays.asList( "holo", "material", "glif", "glif_v2", "glif_v3" ); ArrayList<String> unexpectedIntentThemes = new ArrayList<>(); ArrayList<String> unexpectedStringThemes = new ArrayList<>(); for (final String theme : lightThemes) { Intent intent = new Intent(); intent.putExtra(WizardManagerHelper.EXTRA_THEME, theme); if (WizardManagerHelper.isLightTheme(intent, true)) { unexpectedIntentThemes.add(theme); } if (WizardManagerHelper.isLightTheme(theme, true)) { unexpectedStringThemes.add(theme); } } assertTrue("Intent themes " + unexpectedIntentThemes + " should not be light", unexpectedIntentThemes.isEmpty()); assertTrue("String themes " + unexpectedStringThemes + " should not be light", unexpectedStringThemes.isEmpty()); }
@Test public void testIsLightThemeDefault() { final Intent intent = new Intent(); intent.putExtra("theme", "abracadabra"); assertTrue("isLightTheme should return default value true", WizardManagerHelper.isLightTheme(intent, true)); assertFalse("isLightTheme should return default value false", WizardManagerHelper.isLightTheme(intent, false)); }
@Test public void testIsLightThemeUnspecified() { final Intent intent = new Intent(); assertTrue("isLightTheme should return default value true", WizardManagerHelper.isLightTheme(intent, true)); assertFalse("isLightTheme should return default value false", WizardManagerHelper.isLightTheme(intent, false)); }