@Test
public void testRemove() {

  SessionData sessionData = new SessionData("1", now(), 10);
  RepositoryBackedSession session = mock(RepositoryBackedSession.class);
  when(repository.getSessionData("1")).thenReturn(sessionData);
  when(factory.build(sessionData)).thenReturn(session);
  sessionManager.remove(sessionData);
  assertEquals(1, metrics.meter(MetricRegistry.name(SessionManager.SESSIONS_METRIC_PREFIX, "deleted")).getCount());
}