GoogleAnalyticsTracker implements TrackerAdapter { @Override public void logPageView(String name) { tracker.setScreenName(name); tracker.send(new HitBuilders.ScreenViewBuilder().build()); } GoogleAnalyticsTracker(Tracker tracker); @Override void logPageView(String name); @Override void logEvent(Map<String, Object> eventData); @Override void setUserProperty(String key, Object value); @Override void logException(Throwable e);  }
@SuppressWarnings("unchecked") @Test public void testTrackPageView() { this.subject.logPageView("test"); verify(this.tracker).setScreenName("test"); verify(this.tracker).send(anyMap()); }