Source:
<code>protected void testGetActiveParticipantSource(LogEventRequestType request, Boolean isRequesting, String localIP, Properties webContextProperties) throws UnknownHostException { ActiveParticipant sourceActiveParticipant = null; List<ActiveParticipant> activeParticipant = request.getAuditMessage().getActiveParticipant(); for (ActiveParticipant item : activeParticipant) { if (item.getRoleIDCode().get(0).getDisplayName() != null && item.getRoleIDCode().get(0).getDisplayName(). equals(AuditTransformsConstants.ACTIVE_PARTICIPANT_ROLE_CODE_SOURCE_DISPLAY_NAME)) { sourceActiveParticipant = item; } } if (isRequesting) { assertEquals(NhincConstants.WSA_REPLY_TO, sourceActiveParticipant.getUserID()); <START> } <END> if (isRequesting) { assertEquals(ManagementFactory.getRuntimeMXBean().getName(), sourceActiveParticipant.getAlternativeUserID()); } assertEquals(isRequesting, sourceActiveParticipant.isUserIsRequestor()); if (isRequesting) { assertEquals(localIP, sourceActiveParticipant.getNetworkAccessPointID()); } else { assertEquals(webContextProperties.getProperty(NhincConstants.REMOTE_HOST_ADDRESS), sourceActiveParticipant.getNetworkAccessPointID()); } assertEquals(AuditTransformsConstants.NETWORK_ACCESSOR_PT_TYPE_CODE_NAME, sourceActiveParticipant.getNetworkAccessPointTypeCode()); assertEquals(AuditTransformsConstants.ACTIVE_PARTICIPANT_ROLE_CODE_SOURCE, sourceActiveParticipant.getRoleIDCode().get(0).getCode()); assertEquals(AuditTransformsConstants.ACTIVE_PARTICIPANT_CODE_SYSTEM_NAME, sourceActiveParticipant.getRoleIDCode().get(0).getCodeSystemName()); assertEquals(AuditTransformsConstants.ACTIVE_PARTICIPANT_ROLE_CODE_SOURCE_DISPLAY_NAME, sourceActiveParticipant.getRoleIDCode().get(0).getDisplayName()); }</code><technical_language>Do need in separate if blocks</technical_language>

Target:
protected void testGetActiveParticipantSource(LogEventRequestType request, Boolean isRequesting, String localIP, Properties webContextProperties) throws UnknownHostException { ActiveParticipant sourceActiveParticipant = null; List<ActiveParticipant> activeParticipant = request.getAuditMessage().getActiveParticipant(); for (ActiveParticipant item : activeParticipant) { if (item.getRoleIDCode().get(0).getDisplayName() != null && item.getRoleIDCode().get(0).getDisplayName(). equals(AuditTransformsConstants.ACTIVE_PARTICIPANT_ROLE_CODE_SOURCE_DISPLAY_NAME)) { sourceActiveParticipant = item; } } if (isRequesting) { assertEquals(NhincConstants.WSA_REPLY_TO, sourceActiveParticipant.getUserID()); assertEquals(ManagementFactory.getRuntimeMXBean().getName(), sourceActiveParticipant.getAlternativeUserID()); assertEquals(localIP, sourceActiveParticipant.getNetworkAccessPointID()); } assertEquals(isRequesting, sourceActiveParticipant.isUserIsRequestor()); if (!isRequesting) { assertEquals(webContextProperties.getProperty(NhincConstants.REMOTE_HOST_ADDRESS), sourceActiveParticipant.getNetworkAccessPointID()); } assertEquals(AuditTransformsConstants.NETWORK_ACCESSOR_PT_TYPE_CODE_NAME, sourceActiveParticipant.getNetworkAccessPointTypeCode()); assertEquals(AuditTransformsConstants.ACTIVE_PARTICIPANT_ROLE_CODE_SOURCE, sourceActiveParticipant.getRoleIDCode().get(0).getCode()); assertEquals(AuditTransformsConstants.ACTIVE_PARTICIPANT_CODE_SYSTEM_NAME, sourceActiveParticipant.getRoleIDCode().get(0).getCodeSystemName()); assertEquals(AuditTransformsConstants.ACTIVE_PARTICIPANT_ROLE_CODE_SOURCE_DISPLAY_NAME, sourceActiveParticipant.getRoleIDCode().get(0).getDisplayName()); }