Source:
<code>public PagingResponse<CandidateDTO> getCandidatesByFilterRequest( CandidateFilterRequest candidateFilterRequest) { PageRequest pageRequest; validateCandidateFilterRequest(candidateFilterRequest); if (candidateFilterRequest.getSortName() != null && candidateFilterRequest.getSortOrder() != null) { Sort.Direction sortDirection = Sort.Direction.fromString(candidateFilterRequest.getSortOrder()); pageRequest = new PageRequest(candidateFilterRequest.getPageNumber(), candidateFilterRequest.getPageSize(), sortDirection, candidateFilterRequest.getSortName()); } else { pageRequest = new PageRequest(candidateFilterRequest.getPageNumber(), candidateFilterRequest.getPageSize()); } String name = MoreObjects.firstNonNull(candidateFilterRequest.getCandidateName(), StringUtils.EMPTY); String email = MoreObjects.firstNonNull(candidateFilterRequest.getCandidateEmail(), StringUtils.EMPTY); String phone = MoreObjects.firstNonNull(candidateFilterRequest.getCandidatePhone(), StringUtils.EMPTY); String positions = <START> MoreObjects.firstNonNull(candidateFilterRequest.getCandiadtePositions(), StringUtils.EMPTY); <END> Page<CandidateEntity> candidateEntitiesPage = candidateRepository .findByCandidateFilterRequest(name, email, phone, positions, pageRequest); List<CandidateDTO> candidateDTOs = converterService.convert(candidateEntitiesPage.getContent(), CandidateDTO.class); PagingResponse<CandidateDTO> result = new PagingResponse<>(candidateEntitiesPage.getTotalElements(), candidateDTOs); return result; }</code><technical_language>Minor improvement suggestion: local variables (name, email, phone, position, candidateEntitiesPage, candidateDTOs, result) final</technical_language>

Target:
public PagingResponse<CandidateDTO> getCandidatesByFilterRequest( CandidateFilterRequest candidateFilterRequest) { PageRequest pageRequest; validateCandidateFilterRequest(candidateFilterRequest); if (candidateFilterRequest.getSortName() != null && candidateFilterRequest.getSortOrder() != null) { Sort.Direction sortDirection = Sort.Direction.fromString(candidateFilterRequest.getSortOrder()); pageRequest = new PageRequest(candidateFilterRequest.getPageNumber(), candidateFilterRequest.getPageSize(), sortDirection, candidateFilterRequest.getSortName()); } else { pageRequest = new PageRequest(candidateFilterRequest.getPageNumber(), candidateFilterRequest.getPageSize()); } final String name = MoreObjects.firstNonNull(candidateFilterRequest.getCandidateName(), StringUtils.EMPTY); final String email = MoreObjects.firstNonNull(candidateFilterRequest.getCandidateEmail(), StringUtils.EMPTY); final String phone = MoreObjects.firstNonNull(candidateFilterRequest.getCandidatePhone(), StringUtils.EMPTY); final String positions = MoreObjects.firstNonNull(candidateFilterRequest.getCandiadtePositions(), StringUtils.EMPTY); final Page<CandidateEntity> candidateEntitiesPage = candidateRepository .findByCandidateFilterRequest(name, email, phone, positions, pageRequest); final List<CandidateDTO> candidateDTOs = converterService.convert(candidateEntitiesPage.getContent(), CandidateDTO.class); final PagingResponse<CandidateDTO> result = new PagingResponse<>(candidateEntitiesPage.getTotalElements(), candidateDTOs); return result; }