Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Section> finalSections = new ArrayList<>();
- Language languageToSave = languageFormMapper.toEntity(languageDto);
- List<Section> sections = findSections(languageDto.getSectionIds());
- List<Long> validSectionIds = sections.stream().map(Section::getId).collect(toList());
- languageDto.getSectionIds().forEach(id -> {
- if (validSectionIds.contains(id)) {
- sections.stream().filter(section -> section.getId().equals(id)).forEach(finalSections::add);
- }
- });
- // for (Section section : sections) {
- // if (section.getId().equals(id)) {
- // finalSections.add(section);
- // }
- // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement