MatomoApplication extends Application { public synchronized Tracker getTracker() { if (mMatomoTracker == null) mMatomoTracker = onCreateTrackerConfig().build(getMatomo()); return mMatomoTracker; }  Matomo getMatomo(); synchronized Tracker getTracker(); abstract TrackerBuilder onCreateTrackerConfig(); @Override void onLowMemory(); @Override void onTrimMemory(int level);  }
@Test public void testApplicationGetTracker() { MatomoApplication matomoApplication = (MatomoApplication) Robolectric.application; assertEquals(matomoApplication.getTracker(), matomoApplication.getTracker()); }