@Test
public void testDeleteAsync() {

  sessionManager.deleteAsync("1", true);
  ArgumentCaptor<SessionManager.RunnableWithTimer> captor = ArgumentCaptor
      .forClass(SessionManager.RunnableWithTimer.class);
  verify(executors).submit(captor.capture());
  assertNotNull(captor.getValue().timer);
  SessionData sessionData = new SessionData("1", now(), 10);
  RepositoryBackedSession session = mock(RepositoryBackedSession.class);
  when(repository.getSessionData("1")).thenReturn(sessionData);
  when(factory.build(sessionData)).thenReturn(session);
  captor.getValue().task.run();
  verify(repository).getSessionData("1");
  verify(factory).build(sessionData);
  verify(session).doInvalidate(true);
}