@Ignore @Test public void shouldFindLoopsWherePitchExtractionAreNullOrEmpty(){ HarmonicLoop harmonicLoopOne = new HarmonicLoop(); harmonicLoopOne.setId(1); HarmonicLoop harmonicLoopTwo = new HarmonicLoop(); harmonicLoopTwo.setId(2); harmonicLoopTwo.setPitchExtractions(Arrays.asList(new PitchExtractions())); HarmonicLoop harmonicLoopThree = new HarmonicLoop(); harmonicLoopThree.setId(3); harmonicLoopThree.setPitchExtractions(null); List<HarmonicLoop> filteredLoops = pitchExtractionUtil.findLoopsWithoutPitchExtractions(Arrays.asList(harmonicLoopOne, harmonicLoopTwo, harmonicLoopThree)); assertThat(filteredLoops).hasSize(1); assertThat(filteredLoops.get(0).getId()).isEqualTo(2); }
public List<HarmonicLoop> findLoopsWithoutPitchExtractions(List<HarmonicLoop> harmonicLoops) { return harmonicLoops.stream().filter(harmonicLoop -> harmonicLoop.getPitchExtractions() == null || harmonicLoop.getPitchExtractions().isEmpty()).collect(Collectors.toList()); }
PitchExtractionUtil { public List<HarmonicLoop> findLoopsWithoutPitchExtractions(List<HarmonicLoop> harmonicLoops) { return harmonicLoops.stream().filter(harmonicLoop -> harmonicLoop.getPitchExtractions() == null || harmonicLoop.getPitchExtractions().isEmpty()).collect(Collectors.toList()); } }
PitchExtractionUtil { public List<HarmonicLoop> findLoopsWithoutPitchExtractions(List<HarmonicLoop> harmonicLoops) { return harmonicLoops.stream().filter(harmonicLoop -> harmonicLoop.getPitchExtractions() == null || harmonicLoop.getPitchExtractions().isEmpty()).collect(Collectors.toList()); } @Autowired  PitchExtractionUtil(IHarmonicLoopsDal harmonicLoopsDal); }
PitchExtractionUtil { public List<HarmonicLoop> findLoopsWithoutPitchExtractions(List<HarmonicLoop> harmonicLoops) { return harmonicLoops.stream().filter(harmonicLoop -> harmonicLoop.getPitchExtractions() == null || harmonicLoop.getPitchExtractions().isEmpty()).collect(Collectors.toList()); } @Autowired  PitchExtractionUtil(IHarmonicLoopsDal harmonicLoopsDal); void extractPitchsAndUpdateDatabase(); List<HarmonicLoop> findLoopsWithoutPitchExtractions(List<HarmonicLoop> harmonicLoops); List<PitchExtractions> extractPitchs(HarmonicLoop harmonicLoop, File audioFile); }
PitchExtractionUtil { public List<HarmonicLoop> findLoopsWithoutPitchExtractions(List<HarmonicLoop> harmonicLoops) { return harmonicLoops.stream().filter(harmonicLoop -> harmonicLoop.getPitchExtractions() == null || harmonicLoop.getPitchExtractions().isEmpty()).collect(Collectors.toList()); } @Autowired  PitchExtractionUtil(IHarmonicLoopsDal harmonicLoopsDal); void extractPitchsAndUpdateDatabase(); List<HarmonicLoop> findLoopsWithoutPitchExtractions(List<HarmonicLoop> harmonicLoops); List<PitchExtractions> extractPitchs(HarmonicLoop harmonicLoop, File audioFile); @Autowired
    public AppConfigs appConfigs; }