FacebookTracker implements TrackerAdapter { @Override public void logEvent(Map<String, Object> eventData) { final Map<String, Object> eventDataCopy = new HashMap<>(eventData); String eventName = (String) eventDataCopy.get(Constants.EVENT_NAME); eventDataCopy.remove(Constants.EVENT_NAME); Bundle bundle = new Bundle(); for (Map.Entry<String, ?> entry : eventDataCopy.entrySet()) { if (entry.getValue() != null) { bundle.putString(entry.getKey(), entry.getValue().toString()); } } this.logger.logEvent(eventName, bundle); } FacebookTracker(AppEventsLogger logger); @Override void logPageView(String name); @Override void logEvent(Map<String, Object> eventData); @Override void setUserProperty(String key, Object value); @Override void logException(Throwable e);  }
@Test public void logEvent() throws Exception { this.subject.logEvent(new EventBuilder("test") .setAction("an action") .get()); verify(this.logger).logEvent(eq("test"), any(Bundle.class)); }