ConnectionManagerCache implements ConnectionManager { public void setCommunityId(BusinessEntity businessEntity, String newId) { ConnectionManagerCacheHelper helper = new ConnectionManagerCacheHelper(); KeyedReference ref = helper.getCommunityIdKeyReference(businessEntity); if (ref != null) { ref.setKeyValue(newId); } ref = new KeyedReference(); ref.setKeyValue(newId); businessEntity.getIdentifierBag().getKeyedReference().add(ref); } ConnectionManagerCache();  ConnectionManagerCache(PropertyAccessor accessor); static ConnectionManagerCache getInstance(); void setCommunityId(BusinessEntity businessEntity, String newId); void forceRefreshUDDICache(); void forceRefreshInternalConnectCache(); @Override List<BusinessEntity> getAllBusinessEntities(); @Override BusinessEntity getBusinessEntity(String sHomeCommunityId); @Override String getBusinessEntityName(String homeCommunityId); @Override Set<BusinessEntity> getBusinessEntitySet(List<String> saHomeCommunityId); @Override BusinessEntity getBusinessEntityByServiceName(String sHomeCommunityId, String sUniformServiceName); @Override BusinessEntity getBusinessEntityByHCID(String sHomeCommunityId); @Override Set<BusinessEntity> getBusinessEntitySetByServiceName(List<String> saHomeCommunityId,
        String sUniformServiceName); @Override Set<BusinessEntity> getAllBusinessEntitySetByServiceName(String sUniformServiceName); @Override List<UDDI_SPEC_VERSION> getSpecVersions(String homeCommunityId,
        NhincConstants.NHIN_SERVICE_NAMES serviceName); @Override String getAdapterEndpointURL(String sHomeCommunityId, String sServiceName, ADAPTER_API_LEVEL level); @Override String getAdapterEndpointURL(String sServiceName, ADAPTER_API_LEVEL level); @Override String getDefaultEndpointURLByServiceName(String sHomeCommunityId, String sUniformServiceName); @Override String getEndpointURLByServiceNameSpecVersion(String sHomeCommunityId, String sUniformServiceName,
        UDDI_SPEC_VERSION version); @Override String getInternalEndpointURLByServiceName(String sUniformServiceName); @Override String getEndpointURLFromNhinTarget(NhinTargetSystemType targetSystem, String serviceName); @Override List<UrlInfo> getEndpointURLFromNhinTargetCommunities(NhinTargetCommunitiesType targets, String serviceName); boolean updateInternalServiceUrl(String serviceName, String url);  }
@Test public void testSetCommunityId() { try { ConnectionManagerCache connectionManager = createConnectionManager(); BusinessEntity businessEntity = connectionManager.getBusinessEntity(HCID_1); ConnectionManagerCacheHelper helper = new ConnectionManagerCacheHelper(); String HCID_3 = "3.3"; connectionManager.setCommunityId(businessEntity, HCID_3); String newHCID = helper.getCommunityId(businessEntity); assertTrue(newHCID.equals(HCID_3)); } catch (Throwable t) { t.printStackTrace(); fail("Error running testSetCommunityId test: " + t.getMessage()); } }