### Question:
ParseAnalyticsController { public Task<Void> trackEventInBackground(final String name, Map<String, String> dimensions, String sessionToken) { ParseRESTCommand command = ParseRESTAnalyticsCommand.trackEventCommand(name, dimensions, sessionToken); Task<JSONObject> eventuallyTask = eventuallyQueue.enqueueEventuallyAsync(command, null); return eventuallyTask.makeVoid(); } ParseAnalyticsController(ParseEventuallyQueue eventuallyQueue); Task<Void> trackEventInBackground(final String name,
    Map<String, String> dimensions, String sessionToken); Task<Void> trackAppOpenedInBackground(String pushHash, String sessionToken);  }### Answer:
@Test public void testTrackEvent() throws Exception { ParseEventuallyQueue queue = mock(ParseEventuallyQueue.class); when(queue.enqueueEventuallyAsync(any(ParseRESTCommand.class), any(ParseObject.class))) .thenReturn(Task.forResult(new JSONObject())); ParseAnalyticsController controller = new ParseAnalyticsController(queue); Map<String, String> dimensions = new HashMap<>(); dimensions.put("event", "close"); ParseTaskUtils.wait(controller.trackEventInBackground("name", dimensions, "sessionToken")); ArgumentCaptor<ParseRESTCommand> command = ArgumentCaptor.forClass(ParseRESTCommand.class); ArgumentCaptor<ParseObject> object = ArgumentCaptor.forClass(ParseObject.class); verify(queue, times(1)).enqueueEventuallyAsync(command.capture(), object.capture()); assertNull(object.getValue()); assertTrue(command.getValue() instanceof ParseRESTAnalyticsCommand); assertTrue(command.getValue().httpPath.contains("name")); assertEquals("sessionToken", command.getValue().getSessionToken()); JSONObject jsonDimensions = command.getValue().jsonParameters.getJSONObject("dimensions"); assertEquals("close", jsonDimensions.get("event")); assertEquals(1, jsonDimensions.length()); }