### Question:
ReplayLocationDispatcher implements Runnable { void add(@NonNull List<Location> toReplay) { boolean shouldRedispatch = locationsToReplay.isEmpty(); addLocations(toReplay); if (shouldRedispatch) { stopDispatching(); scheduleNextDispatch(); } } ReplayLocationDispatcher(@NonNull List<Location> locationsToReplay);   ReplayLocationDispatcher(List<Location> locationsToReplay, Handler handler); @Override void run();  }### Answer:
@Test public void checksAddLocationsWhenAdd() { List<Location> anyLocations = mock(List.class); Handler aHandler = mock(Handler.class); ReplayLocationDispatcher theReplayLocationDispatcher = new ReplayLocationDispatcher(anyLocations, aHandler); List<Location> locationsToReplay = mock(List.class); theReplayLocationDispatcher.add(locationsToReplay); verify(anyLocations, times(1)).addAll(eq(locationsToReplay)); }