PatientValidator { @NotNull @VisibleForTesting static List<ValidationFinding> validateTumorLocationCuration(@NotNull String patientIdentifier, @NotNull BaselineData baselineData) { List<ValidationFinding> findings = Lists.newArrayList(); String searchTerm = baselineData.curatedTumorLocation().searchTerm(); if (searchTerm != null && !searchTerm.isEmpty() && baselineData.curatedTumorLocation().primaryTumorLocation() == null) { findings.add(ValidationFinding.of("tumorLocationCuration", patientIdentifier, "Failed to curate primary tumor location", baselineData.primaryTumorStatus(), searchTerm)); } return findings; }  @NotNull static List<ValidationFinding> validatePatient(@NotNull Patient patient);  }
@Test public void reportsFailureToCuratePrimaryTumorLocation() { List<ValidationFinding> findings = PatientValidator.validateTumorLocationCuration(PATIENT_IDENTIFIER, BASELINE_DATA_MISSING_LOCATION_MAPPING); assertEquals(1, findings.size()); assertEquals("tumorLocationCuration", findings.get(0).level()); }