### Question:
DispatcherFlusherImpl implements DispatcherFlusher { @Override public final Map<Agent, ReplicationResult> flush(final ResourceResolver resourceResolver, final String... paths) throws ReplicationException { return this.flush(resourceResolver, ReplicationActionType.ACTIVATE, false, paths); }  @Override final Map<Agent, ReplicationResult> flush(final ResourceResolver resourceResolver, final String... paths); @Override final Map<Agent, ReplicationResult> flush(final ResourceResolver resourceResolver,
                                                     final ReplicationActionType actionType,
                                                     final boolean synchronous,
                                                     final String... paths); @Override final Map<Agent, ReplicationResult> flush(final ResourceResolver resourceResolver,
                                                     final ReplicationActionType actionType,
                                                     final boolean synchronous,
                                                     final AgentFilter agentFilter,
                                                     final String... paths); final Agent[] getFlushAgents(); final Agent[] getAgents(final AgentFilter agentFilter);  }### Answer:
@Test public void testFlush() throws Exception { final ResourceResolver resourceResolver = mock(ResourceResolver.class); final Session session = mock(Session.class); when(resourceResolver.adaptTo(Session.class)).thenReturn(session); final String path1 = "/content/foo"; final String path2 = "/content/bar"; dispatcherFlusher.flush(resourceResolver, path1, path2); verify(replicator, times(1)).replicate(eq(session), eq(ReplicationActionType.ACTIVATE), eq(path1), any(ReplicationOptions.class)); verify(replicator, times(1)).replicate(eq(session), eq(ReplicationActionType.ACTIVATE), eq(path2), any(ReplicationOptions.class)); verifyNoMoreInteractions(replicator); }
@Test public void testFlush_2() throws Exception { final ResourceResolver resourceResolver = mock(ResourceResolver.class); final Session session = mock(Session.class); when(resourceResolver.adaptTo(Session.class)).thenReturn(session); final ReplicationActionType actionType = ReplicationActionType.DELETE; final boolean synchronous = false; final String path1 = "/content/foo"; final String path2 = "/content/bar"; dispatcherFlusher.flush(resourceResolver, actionType, synchronous, path1, path2); verify(replicator, times(1)).replicate(eq(session), eq(actionType), eq(path1), any(ReplicationOptions.class)); verify(replicator, times(1)).replicate(eq(session), eq(actionType), eq(path2), any(ReplicationOptions.class)); verifyNoMoreInteractions(replicator); }