WorkspaceActivityManager { public long countWorkspacesInStatus(WorkspaceStatus status, long threshold) throws ServerException { return activityDao.countWorkspacesInStatus(status, threshold); } @Inject  WorkspaceActivityManager(
      WorkspaceManager workspaceManager,
      WorkspaceActivityDao activityDao,
      EventService eventService,
      @Named("che.limits.workspace.idle.timeout") long timeout,
      @Named("che.limits.workspace.run.timeout") long runTimeout); @VisibleForTesting  WorkspaceActivityManager(
      WorkspaceManager workspaceManager,
      WorkspaceActivityDao activityDao,
      EventService eventService,
      long timeout,
      long runTimeout,
      Clock clock); void update(String wsId, long activityTime); Page<String> findWorkspacesInStatus(
      WorkspaceStatus status, long threshold, int maxItems, long skipCount); long countWorkspacesInStatus(WorkspaceStatus status, long threshold); static final long MINIMAL_TIMEOUT; }
@Test public void shouldCountWorkspacesInStatus() throws Exception { when(workspaceActivityDao.countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L))) .thenReturn(15L); long count = activityManager.countWorkspacesInStatus(WorkspaceStatus.STARTING, 0L); verify(workspaceActivityDao).countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L)); assertEquals(15L, count); }