### Question:
EmpiResourceFilteringSvc { public boolean shouldBeProcessed(IAnyResource theResource) { String resourceType = myFhirContext.getResourceType(theResource); List<EmpiResourceSearchParamJson> candidateSearchParams = myEmpiSettings.getEmpiRules().getCandidateSearchParams(); if (candidateSearchParams.isEmpty()) { return true; } boolean containsValueForSomeSearchParam = candidateSearchParams.stream() .filter(csp -> myEmpiSearchParamSvc.searchParamTypeIsValidForResourceType(csp.getResourceType(), resourceType)) .flatMap(csp -> csp.getSearchParams().stream()) .map(searchParam -> myEmpiSearchParamSvc.getValueFromResourceForSearchParam(theResource, searchParam)) .anyMatch(valueList -> !valueList.isEmpty()); ourLog.trace("Is {} suitable for EMPI processing? : {}", theResource.getId(), containsValueForSomeSearchParam); return containsValueForSomeSearchParam; }  boolean shouldBeProcessed(IAnyResource theResource);  }### Answer:
@Test public void testFilterResourcesWhichHaveNoRelevantAttributes() { Patient patient = new Patient(); patient.setDeceased(new BooleanType(true)); boolean shouldBeProcessed = myEmpiResourceFilteringSvc.shouldBeProcessed(patient); assertThat(shouldBeProcessed, is(equalTo(false))); }
@Test public void testDoNotFilterResourcesWithEMPIAttributes() { Patient patient = new Patient(); patient.addIdentifier().setValue("Hey I'm an ID! rules defined in empi-rules.json care about me!"); boolean shouldBeProcessed = myEmpiResourceFilteringSvc.shouldBeProcessed(patient); assertThat(shouldBeProcessed, is(equalTo(true))); }