FoamMain { protected void init(FoamApiKeys foamApiKeys) { this.foamApiKeys = foamApiKeys; services.put(ServiceType.PAGERDUTY, new PagerDuty(context)); services.put(ServiceType.HOCKEYAPP, new HockeyApp(context)); services.put(ServiceType.PAPERTRAIL, new PaperTrail(context)); services.put(ServiceType.LOGENTRIES, new LogEntries(context)); services.put(ServiceType.MIXPANEL, new Mixpanel(context)); services.put(ServiceType.FLURRY, new Flurry(context)); services.put(ServiceType.GOOGLE_ANALYTICS, new GoogleAnalytics(context)); services.put(ServiceType.GRAPHITE, new Graphite(context)); } FoamMain(Context context);   }
@Test public void testInit() { FoamMain foamMain = new FoamMain(null); foamMain.init(null); Set<ServiceType> registeredServiceTypes = foamMain.services.keySet(); List<ServiceType> availableServiceTypes = Arrays.asList(ServiceType.values()); assertTrue( "Some service defined in ServiceType.java were not registered after calling FoamMain#init()", registeredServiceTypes.containsAll(availableServiceTypes) ); }