### Question:
ContextThemeWrapper extends ContextWrapper { @Override protected void attachBaseContext(Context newBase) { super.attachBaseContext(newBase); } ContextThemeWrapper();  ContextThemeWrapper(Context base, @StyleRes int themeResId);  ContextThemeWrapper(Context base, Resources.Theme theme); void applyOverrideConfiguration(Configuration overrideConfiguration); @Override Resources getResources(); @Override void setTheme(int resid); int getThemeResId(); @Override Resources.Theme getTheme(); @Override Object getSystemService(String name); @Override AssetManager getAssets();  }### Answer:
@Test public void testAttachBaseContext() { assertTrue((new ContextThemeWrapper() { public boolean test() { try { attachBaseContext(new ContextThemeWrapper(mContext, R.style.TextAppearance)); } catch (IllegalStateException e) { fail("test attachBaseContext fail"); } try { attachBaseContext(new ContextThemeWrapper()); fail("test attachBaseContext fail"); } catch (IllegalStateException e) { } return true; } }).test()); }