ServiceRegistry implements IServiceRegistry { @Override public Map<String, String> getServiceIdNameMap() { serviceIdNameMap = new HashMap<String,String>(); Iterator<?> iterator = servicesMap.entrySet().iterator(); while(iterator.hasNext()){ @SuppressWarnings("rawtypes") Map.Entry entry = (Map.Entry)iterator.next(); IService serviceObj = (IService)entry.getValue(); serviceIdNameMap.put(serviceObj.getServiceId(), serviceObj.getName()); } return serviceIdNameMap; }  @PostConstruct void init(); @Override IService getServiceObject(String serviceId); @Override Map<String, String> getServiceIdNameMap();  }
@Test public void testGetServiceNameIdMap() { Map<String, String> services = new HashMap<String, String>(); services.put(viafService.getServiceId(), viafService.getName()); services.put(conceptpowerService.getServiceId(), conceptpowerService.getName()); assertEquals(serviceRegistry.getServiceIdNameMap(), services); }