ExchangeManagerHelper { public static String getNhinServiceName(List<String> serviceNames) { for (String name : serviceNames) { if (isServiceNameMatch(name)) { return NhincConstants.NHIN_SERVICE_NAMES.fromValueString(name).getUDDIServiceName(); } } return null; } private  ExchangeManagerHelper(); static boolean organizationHasService(OrganizationType org, String sUniformServiceName); static boolean hasService(EndpointType epType, String sUniformServiceName); static List<NhincConstants.UDDI_SPEC_VERSION> getSpecVersions(EndpointType epType); static EndpointConfigurationType getEndPointConfigBasedOnSpecVersion(EndpointType epType, String version); static String getHomeCommunityFromPropFile(); static NhincConstants.UDDI_SPEC_VERSION getHighestUDDISpecVersion(
        List<NhincConstants.UDDI_SPEC_VERSION> specVersions); static String getEndpointURLByServiceNameSpecVersion(OrganizationType org, String serviceName,
        NhincConstants.UDDI_SPEC_VERSION version); static String getEndpointURLBySpecVersion(EndpointConfigurationListType epConfigList,
        NhincConstants.UDDI_SPEC_VERSION version); static EndpointType getServiceEndpointType(OrganizationType org, String serviceName); static List<OrganizationType> getOrganizationTypeBy(ExchangeInfoType exchangeInfo); static List<OrganizationType> getOrganizationTypeBy(ExchangeInfoType exchangeInfo, boolean requiredElement); static List<OrganizationType> getOrganizationTypeBy(ExchangeType exchange); static List<OrganizationType> getOrganizationTypeBy(ExchangeType exchange, boolean requiredElement); static List<OrganizationType> getOrganizationTypeBy(ExchangeInfoType exchangeInfo, String exchangeName); static List<OrganizationType> getOrganizationTypeBy(ExchangeInfoType exchangeInfo, String exchangeName,
        boolean requiredElement); static OrganizationType findOrganizationTypeBy(List<OrganizationType> organizations, String hcid); static List<OrganizationType> getOrganizationTypeAll(ExchangeInfoType exchangeInfo); static List<OrganizationType> getOrganizationTypeAllByCache(
        Map<String, Map<String, OrganizationType>> exCache); static List<ExchangeType> getExchangeTypeBy(ExchangeInfoType exchangeInfo); static List<ExchangeType> getExchangeTypeBy(ExchangeInfoType exchangeInfo, boolean requiredElement); static ExchangeType findExchangeTypeBy(List<ExchangeType> exchanges, String exchangeName); static EndpointConfigurationType findEndpointConfigurationTypeBy(EndpointType endpoint,
        UDDI_SPEC_VERSION version); static List<EndpointConfigurationType> getEndpointConfigurationTypeBy(EndpointType endpoint); static List<EndpointConfigurationType> getEndpointConfigurationTypeBy(EndpointType endpoint,
        boolean requiredElement); static EndpointConfigurationType findEndpointConfigurationTypeBy(
        List<EndpointConfigurationType> epConfigurations, UDDI_SPEC_VERSION version); static List<EndpointType> getEndpointTypeBy(ExchangeInfoType exchangeInfo, String exchangeName, String hcid); static List<EndpointType> getEndpointTypeBy(OrganizationType organization); static List<EndpointType> getEndpointTypeBy(OrganizationType organization, boolean requiredElement); static EndpointType findEndpointTypeBy(OrganizationType organization, String serviceName); static EndpointType findEndpointTypeBy(List<EndpointType> endpoints, String serviceName); static String getNhinServiceName(List<String> serviceNames); static Map<String, String> getSpecVersionsAndUrlMap(EndpointType epType); static EXCHANGE_TYPE[] getDisplayExchangeTypes(); static List<ExchangeType> getAllExchanges(ExchangeInfoType exchangeInfo, boolean requiredElement); static List<ExchangeType> copyExchangeTypeList(List<ExchangeType> exchangeList); static String getExchangeAlias(String exchangeName);  }
@Test public void multipleEndpointNamesTest() { List<String> epNames = new ArrayList<>(); epNames.add("null"); epNames.add(null); epNames.add(" "); epNames.add(QUERY_FOR_DOCUMENT); epNames.add(QUERY_FOR_DOCUMENTS); String serviceName = ExchangeManagerHelper.getNhinServiceName(epNames); assertEquals("Service Name not found", QUERY_FOR_DOCUMENTS, serviceName); }