### Question:
PatientSearchCriteria { String copySearchParameter(String source, String target) { if (!StringUtils.isBlank(source) && StringUtils.isBlank(target)) { return source; } return target; } PatientSearchCriteria(SessionFactory sessionFactory, Criteria criteria); Criteria prepareCriteria(String name, String identifier, List<PatientIdentifierType> identifierTypes,
	        boolean matchIdentifierExactly, boolean orderByNames, boolean searchOnNamesOrIdentifiers);  }### Answer:
@Test public void copySearchParameter_shouldReturnSourceValueWhenTargetIsBlank() { Assert.assertEquals("source", patientSearchCriteria.copySearchParameter("source", null)); Assert.assertEquals("source", patientSearchCriteria.copySearchParameter("source", "")); Assert.assertEquals("source", patientSearchCriteria.copySearchParameter("source", " \n\t ")); }
@Test public void copySearchParameter_shouldReturnTargetValueWhenTargetIsNonblank() { Assert.assertEquals("target", patientSearchCriteria.copySearchParameter(null, "target")); Assert.assertEquals("target", patientSearchCriteria.copySearchParameter("", "target")); Assert.assertEquals("target", patientSearchCriteria.copySearchParameter(" \n\t ", "target")); Assert.assertEquals("target", patientSearchCriteria.copySearchParameter("source", "target")); }
@Test public void copySearchParameter_shouldReturnSourceValueWhenTargetIsBlank() throws Exception { Assert.assertEquals("source", patientSearchCriteria.copySearchParameter("source", null)); Assert.assertEquals("source", patientSearchCriteria.copySearchParameter("source", "")); Assert.assertEquals("source", patientSearchCriteria.copySearchParameter("source", " \n\t ")); }
@Test public void copySearchParameter_shouldReturnTargetValueWhenTargetIsNonblank() throws Exception { Assert.assertEquals("target", patientSearchCriteria.copySearchParameter(null, "target")); Assert.assertEquals("target", patientSearchCriteria.copySearchParameter("", "target")); Assert.assertEquals("target", patientSearchCriteria.copySearchParameter(" \n\t ", "target")); Assert.assertEquals("target", patientSearchCriteria.copySearchParameter("source", "target")); }