little refactor
This commit is contained in:
@ -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();
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user