AuditDataTransformHelper { public static ExternalIdentifierType findSingleExternalIdentifier(final List<ExternalIdentifierType> olExtId, final String sIdentScheme) { ExternalIdentifierType oExtId = null; if (CollectionUtils.isNotEmpty(olExtId)) { for (int i = 0; i < olExtId.size(); i++) { if (olExtId.get(i).getIdentificationScheme().equals(sIdentScheme)) { oExtId = olExtId.get(i); break; } } } return oExtId; }  static EventIdentificationType createEventIdentification(final String actionCode, final Integer eventOutcome,
        final CodedValueType eventId); static CodedValueType createEventId(final String eventCode, final String eventCodeSys,
        final String eventCodeSysName, final String dispName); static CodedValueType createCodeValueType(final String code, final String codeSys, final String codeSysName,
        final String dispName); static AuditMessageType.ActiveParticipant createActiveParticipantFromUser(final UserType userInfo,
        final Boolean userIsReq); static AuditMessageType.ActiveParticipant createActiveParticipant(final String userId,
        final String altUserId, final String userName, final Boolean userIsReq); static AuditSourceIdentificationType createAuditSourceIdentificationFromUser(final UserType userInfo); static AuditSourceIdentificationType createAuditSourceIdentification(final String communityId,
        final String communityName); static ParticipantObjectIdentificationType createParticipantObjectIdentification(final String patientId); static ParticipantObjectIdentificationType createDocumentParticipantObjectIdentification(
        final String documentId); static void logAuditMessage(final AuditMessageType message); static ExternalIdentifierType findSingleExternalIdentifier(final List<ExternalIdentifierType> olExtId,
        final String sIdentScheme); static String findSingleExternalIdentifierAndExtractValue(final List<ExternalIdentifierType> olExtId,
        final String sIdentScheme); static String createCompositePatientId(final String assigningAuthId, final String patientId); static String createCompositePatientIdFromAssertion(final UserType userInfo, final String patientId);  }
@Test public void testFindSingleExternalIdentifier() { ExternalIdentifierType extId1 = new ExternalIdentifierType(); ExternalIdentifierType extId2 = new ExternalIdentifierType(); extId1.setIdentificationScheme("2.16.840.1.113883.3.198"); List<ExternalIdentifierType> olExtId = new ArrayList(); olExtId.add(extId1); extId2.setIdentificationScheme("2.16.840.1.113883.3.200"); olExtId.add(extId2); String sIdentScheme = "2.16.840.1.113883.3.198"; ExternalIdentifierType expResult = new ExternalIdentifierType(); expResult = extId1; ExternalIdentifierType result = AuditDataTransformHelper.findSingleExternalIdentifier(olExtId, sIdentScheme); assertEquals(expResult.getIdentificationScheme(), result.getIdentificationScheme()); }