IndicatorUtils { public static List<Implication> filterImplication(List<Implication> implications) { return implications.stream().filter(implication -> implication.getLevelOfEvidence() != null) .map(UniqueImplication::new) .distinct() .map(UniqueImplication::unwrap) .collect(Collectors.toList()); }  static IndicatorQueryResp processQuery(Query query,
                                                  Set<LevelOfEvidence> levels, Boolean highestLevelOnly,
                                                  Set<EvidenceType> evidenceTypes); static List<Implication> filterImplication(List<Implication> implications); static IndicatorQueryOncogenicity getOncogenicity(Alteration alteration, List<Alteration> alternativeAllele, List<Alteration> relevantAlterations); static Map<String, LevelOfEvidence> findHighestLevelByEvidences(Set<Evidence> treatmentEvidences); static Map<String, Object> findFusionGeneAndRelevantAlts(Query query);  }
@Test public void testFilterImplication() { TumorType melanoma = new TumorType(); melanoma.setName("Melanoma"); melanoma.setCode("MEL"); MainType mainType = new MainType(); mainType.setName("Melanoma"); melanoma.setMainType(mainType); TumorType nsclc = new TumorType(); nsclc.setName("Non-Small Cell Lung Cancer"); nsclc.setCode("NSCLC"); MainType nsclcMainType = new MainType(); nsclcMainType.setName("Non-Small Cell Lung Cancer"); nsclc.setMainType(mainType); Implication implication1 = new Implication(); implication1.setDescription("implication1"); implication1.setTumorType(melanoma); implication1.setLevelOfEvidence(LevelOfEvidence.LEVEL_Dx1); Implication implication2 = new Implication(); implication2.setDescription("implication2"); implication2.setTumorType(melanoma); implication2.setLevelOfEvidence(LevelOfEvidence.LEVEL_Dx1); Implication implication3 = new Implication(); implication3.setDescription("implication3"); implication3.setTumorType(nsclc); implication3.setLevelOfEvidence(LevelOfEvidence.LEVEL_Dx1); List<Implication> implications = new ArrayList<>(); implications.add(implication1); implications.add(implication2); implications.add(implication3); List<Implication> filteredImplications = IndicatorUtils.filterImplication(implications); assertEquals(2, filteredImplications.size()); assertEquals("implication1", filteredImplications.get(0).getDescription()); assertEquals("implication3", filteredImplications.get(1).getDescription()); Implication implication4 = new Implication(); implication4.setDescription("implication3"); implication4.setTumorType(melanoma); implication4.setLevelOfEvidence(null); implications = new ArrayList<>(); implications.add(implication4); filteredImplications = IndicatorUtils.filterImplication(implications); assertEquals(0, filteredImplications.size()); }