little refactor

This commit is contained in:
BuildTools
2020-10-29 17:38:05 +01:00
parent 3a3e6dc427
commit ed00731654
4 changed files with 21 additions and 18 deletions

View File

@ -42,14 +42,13 @@ public class GroupService {
return this.repo.findById(id);
}
public Long findNotExistingGroup(List<Long> ids) {
Long response = Long.MIN_VALUE;
public Optional<Long> findNotExistingGroup(List<Long> ids) {
for (Long oneId : ids) {
if (this.repo.existsById(oneId) == false) {
response = oneId;
return Optional.of(oneId);
}
}
return response;
return Optional.empty();
}
}