ClinicalTrialFactory { @NotNull public static List<ClinicalTrial> extractOnLabelTrials(@NotNull List<EvidenceItem> evidenceItems) { List<ClinicalTrial> trials = Lists.newArrayList(); for (EvidenceItem evidence : evidenceItems) { if (evidence.source().isTrialSource() && evidence.isOnLabel()) { trials.add(toClinicalTrial(evidence)); } } return trials; } private  ClinicalTrialFactory(); @NotNull static List<ClinicalTrial> extractOnLabelTrials(@NotNull List<EvidenceItem> evidenceItems);  }
@Test public void canExtractClinicalTrials() { EvidenceItem item = createTestEvidenceBuilder().event("event") .drug("acronym") .source(ActionabilitySource.ICLUSION) .reference("reference") .isOnLabel(true) .build(); List<ClinicalTrial> trial = ClinicalTrialFactory.extractOnLabelTrials(Lists.newArrayList(item)); assertEquals(1, trial.size()); assertEquals("event", trial.get(0).event()); assertEquals("acronym", trial.get(0).acronym()); assertEquals("reference", trial.get(0).reference()); assertEquals(ActionabilitySource.ICLUSION, trial.get(0).source()); }