FactoryReloads { @SuppressWarnings("fallthrough") public static void performReloads( final SiteContext genericCxt, final ReloadArg reload){ final Site site = genericCxt.getSite(); switch(reload){ case ALL: case SITE_CONFIGURATION: performReload(site, SiteConfiguration.instanceOf( ContextWrapper.wrap(SiteConfiguration.Context.class, genericCxt))); if(ReloadArg.ALL != reload){ break;} case SEARCH_TAB_FACTORY: performReload(site, SearchTabFactory.instanceOf( ContextWrapper.wrap(SearchTabFactory.Context.class, genericCxt))); if(ReloadArg.ALL != reload){ break;} case SEARCH_MODE_FACTORY: performReload(site, SearchModeFactory.instanceOf( ContextWrapper.wrap(SearchModeFactory.Context.class, genericCxt))); if( ReloadArg.ALL != reload){ break;} case ANALYSIS_RULES_FACTORY: performReload(site, AnalysisRuleFactory.instanceOf( ContextWrapper.wrap(AnalysisRuleFactory.Context.class, genericCxt))); case VELOCITY_ENGINE_FACTORY: performReload(site, VelocityEngineFactory.instanceOf( ContextWrapper.wrap(VelocityEngineFactory.Context.class, genericCxt))); if(ReloadArg.ALL != reload){ break;} } System.gc(); } private  FactoryReloads(); @SuppressWarnings("fallthrough") static void performReloads(
            final SiteContext genericCxt,
            final ReloadArg reload);  }
@Test public void testRemoveAll() { FactoryReloads.performReloads(genericContext(), ReloadArg.SITE_CONFIGURATION); FactoryReloads.performReloads(genericContext(), ReloadArg.SEARCH_TAB_FACTORY); FactoryReloads.performReloads(genericContext(), ReloadArg.SEARCH_MODE_FACTORY); FactoryReloads.performReloads(genericContext(), ReloadArg.ANALYSIS_RULES_FACTORY); }