### Question:
ExportTaskManager implements IExportTaskManager { @Override public int getTasksTotalPages(IUser user) { int totalTasks = getTasksTotal(user); int pagesTotal = totalTasks / tasksPageSize; if (totalTasks % tasksPageSize > 0) { pagesTotal += 1; } return pagesTotal; }  @Override IExportTask createExportTask(ExportType exportType, String username, ExportStatus status); @Override IExportTask saveAndFlush(IExportTask task); @Override IExportTask save(IExportTask task); @Override IExportTask get(String id); @Override List<IExportTask> getTasks(IUser user, int page); @Override int getTasksTotal(IUser user); @Override int getTasksTotalPages(IUser user); @Override void updateTask(IExportJob job);  }### Answer:
@Test public void test_getTasksTotalPages_onePage() { Mockito.when(taskRepo.countByUsername(USERNAME)).thenReturn(5); Assert.assertEquals(1, managerToTest.getTasksTotalPages(user)); }
@Test public void test_getTasksTotalPages_moreThanOnePage() { Mockito.when(taskRepo.countByUsername(USERNAME)).thenReturn(24); Assert.assertEquals(5, managerToTest.getTasksTotalPages(user)); }