Buggy code:
public class XdsDocumentRepositoryServiceImplTest extends BaseModuleContextSensitiveTest { @ Before public void setup ( ) throws Exception { } @ SuppressWarnings ( "unchecked" ) private < T > T parseRequestFromResourceName ( String resourceName ) throws FileNotFoundException , JAXBException { } @ Test public void findOrCreatePatient_shouldCreateANewPatientIfNoPatientCanBeFound ( ) throws FileNotFoundException , ParseException , JAXBException , PatientIdentifierException , UnsupportedGenderException { XdsDocumentRepositoryServiceImpl service = new XdsDocumentRepositoryServiceImpl ( ) ; ProvideAndRegisterDocumentSetRequestType request = parseRequestFromResourceName ( "provideAndRegRequest2.xml" ) ; List < ExtrinsicObjectType > extrinsicObjects = InfosetUtil . getExtrinsicObjects ( request . getSubmitObjectsRequest ( ) ) ; ExtrinsicObjectType eo = extrinsicObjects . get ( 0 ) ; Patient pat ; try { pat = service . findOrCreatePatient ( eo ) ; assertNotNull ( pat ) ; assertEquals ( "M" , pat . getGender ( ) ) ; SimpleDateFormat sdf = new SimpleDateFormat ( "yyyyMMdd" ) ; String dob = sdf . format ( pat . getBirthdate ( ) ) ; <START_BUG> assertEquals ( "19670101" , dob ) ; <END_BUG> assertEquals ( "John" , pat . getGivenName ( ) ) ; assertEquals ( "Doe" , pat . getFamilyName ( ) ) ; PersonAddress pa = pat . getAddresses ( ) . iterator ( ) . next ( ) ; assertEquals ( "100<seq2seq4repair_space>Main<seq2seq4repair_space>St" , pa . getAddress1 ( ) ) ; assertEquals ( "Metropolis" , pa . getCityVillage ( ) ) ; assertEquals ( "Il" , pa . getStateProvince ( ) ) ; assertEquals ( "44130" , pa . getPostalCode ( ) ) ; assertEquals ( "USA" , pa . getCountry ( ) ) ; PatientService ps = Context . getPatientService ( ) ; PatientIdentifierType patientIdentifierType = ps . getPatientIdentifierTypeByName ( "1.2.4" ) ; assertNotNull ( patientIdentifierType ) ; } catch ( UnknownPatientException e ) { e . printStackTrace ( ) ; fail ( ) ; } } @ Test public void findOrCreatePatient_shouldFindAnExistingPatient ( ) throws FileNotFoundException , ParseException , JAXBException , PatientIdentifierException , UnsupportedGenderException { } @ Test public void findOrCreatePatient_shouldThrowUnsupportedGenderException ( ) throws FileNotFoundException , ParseException , JAXBException , PatientIdentifierException { } @ Test public void findOrCreateProvider_shouldCreateNewProvidersAndEncounterRolesIfNoneCanBeFound ( ) throws FileNotFoundException , JAXBException { } @ Test public void findOrCreateProvider_shouldFindAnExistingProviderAndEncounterRole ( ) throws FileNotFoundException , JAXBException { } @ Test public void findOrCreateEncounterType_shouldFindAnExistingEncounterType ( ) throws FileNotFoundException , JAXBException { } @ Test public void findOrCreateEncounterType_shouldCreateANewEncounterType ( ) throws FileNotFoundException , JAXBException { } @ Test public void storeDocument_shouldReturnTheDocumentUniqueId ( ) throws FileNotFoundException , UnsupportedEncodingException , ParseException , JAXBException , PatientIdentifierException , UnsupportedGenderException { } @ SuppressWarnings ( "unchecked" ) @ Test public void storeDocument_shouldCallARegisteredContentHandler ( ) throws Exception { } @ Test public void retrieveDocumentSetB_shouldFetchContentFromTheRegisteredContentHandlerAndReturnSuccess ( ) throws FileNotFoundException , UnsupportedEncodingException , ClassNotFoundException , ParseException , JAXBException , AlreadyRegisteredException , InvalidCodedValueException , UnsupportedGenderException { } @ Test public void retrieveDocumentSetB_shouldReturnARegistryErrorIfDocumentNotFound ( ) throws FileNotFoundException , UnsupportedEncodingException , ClassNotFoundException , ParseException , JAXBException , AlreadyRegisteredException , InvalidCodedValueException , UnsupportedGenderException { } @ Test public void retrieveDocumentSetB_shouldReturnARegistryErrorIfRepositoryIdIsNotKnow ( ) throws FileNotFoundException , UnsupportedEncodingException , ClassNotFoundException , ParseException , JAXBException , AlreadyRegisteredException , InvalidCodedValueException , UnsupportedGenderException { } @ Test public void retrieveDocumentSetB_shouldReturnPartialSuccessIfNotAllDocWereFound ( ) throws FileNotFoundException , UnsupportedEncodingException , ClassNotFoundException , ParseException , JAXBException , AlreadyRegisteredException , InvalidCodedValueException , UnsupportedGenderException { } @ Test public void retrieveDocumentSetB_shouldCallTheDefaultHandlerIfNoRegisteredHandlersAreFound ( ) throws FileNotFoundException , UnsupportedEncodingException , ClassNotFoundException , ParseException , JAXBException , AlreadyRegisteredException , InvalidCodedValueException , UnsupportedGenderException { } }

Fix:
assertEquals ( "19560527" , dob ) ;