Tracker { public void setDispatchMode(DispatchMode mode) { mDispatchMode = mode; if (mode != DispatchMode.EXCEPTION) { getPreferences().edit().putString(PREF_KEY_DISPATCHER_MODE, mode.toString()).apply(); } mDispatcher.setDispatchMode(mode); } protected  Tracker(Matomo matomo, TrackerBuilder config); void addTrackingCallback(Callback callback); void removeTrackingCallback(Callback callback); void setOptOut(boolean optOut); boolean isOptOut(); String getName(); Matomo getMatomo(); String getAPIUrl(); TrackMe getDefaultTrackMe(); void startNewSession(); void setSessionTimeout(int milliseconds); long getSessionTimeout(); int getDispatchTimeout(); void setDispatchTimeout(int timeout); void dispatch(); void dispatchBlocking(); Tracker setDispatchInterval(long dispatchInterval); Tracker setDispatchGzipped(boolean dispatchGzipped); long getDispatchInterval(); void setOfflineCacheAge(long age); long getOfflineCacheAge(); void setOfflineCacheSize(long size); long getOfflineCacheSize(); DispatchMode getDispatchMode(); void setDispatchMode(DispatchMode mode); Tracker setUserId(String userId); String getUserId(); Tracker setVisitorId(String visitorId); String getVisitorId(); Tracker track(TrackMe trackMe); static String makeRandomVisitorId(); SharedPreferences getPreferences(); @Override boolean equals(Object o); @Override int hashCode(); @VisibleForTesting TrackMe getLastEventX(); void setDryRunTarget(List<Packet> dryRunTarget); List<Packet> getDryRunTarget();  }
@Test public void testSetDispatchMode_propagation() { mTrackerPreferences.edit().clear(); Tracker tracker = new Tracker(mMatomo, mTrackerBuilder); verify(mDispatcher, times(1)).setDispatchMode(any()); }