@Test
public void given31Employees_whenPartitioningFor1NodeWith5PartitionsPerNode_thenDistributeCorrectly() throws Exception {

    List<Long> employeeIds = new ArrayList<>();
    for (long i = 1; i <= 31; i++) {
        employeeIds.add(i);
    }
    when(taxCalculationRepository.getUnprocessedEmployeeIds(anyLong(), anyLong(), anyLong())).thenReturn(employeeIds);
    Map<String, ExecutionContext> partitions = employeeJobPartitioner.partition(1);
    assertThat(partitions).hasSize(5);
    assertThat(partitions.get("partition0").getLong("minValue")).isEqualTo(1L);
    assertThat(partitions.get("partition0").getLong("maxValue")).isEqualTo(7L);
    assertThat(partitions.get("partition1").getLong("minValue")).isEqualTo(8L);
    assertThat(partitions.get("partition1").getLong("maxValue")).isEqualTo(14L);
    assertThat(partitions.get("partition2").getLong("minValue")).isEqualTo(15L);
    assertThat(partitions.get("partition2").getLong("maxValue")).isEqualTo(21L);
    assertThat(partitions.get("partition3").getLong("minValue")).isEqualTo(22L);
    assertThat(partitions.get("partition3").getLong("maxValue")).isEqualTo(28L);
    assertThat(partitions.get("partition4").getLong("minValue")).isEqualTo(29L);
    assertThat(partitions.get("partition4").getLong("maxValue")).isEqualTo(31L);
}