RegistryServiceLookup { public Map<String, XfsServiceClass> lookup() { final String method = "lookup()"; Map<String, XfsServiceClass> services = new HashMap<String, XfsServiceClass>(); for (final HKEY hKey : hKeys) { HKEY subKey = null; try { subKey = xfsConf.wfmOpenKey(hKey, KEY_NAME_LOGICAL_SERVICES); final Enumeration<String> enumeration = new RegistryKeyEnumerator( subKey); while (enumeration.hasMoreElements()) { final String logicalName = enumeration.nextElement(); if (services.containsKey(logicalName)) { continue; } final XfsServiceClass serviceClass = retrievesServiceClass( subKey, logicalName); if (serviceClass != null) { services.put(logicalName, serviceClass); } } } catch (XfsException e) { LOG.error(method, "Error opening registry Key: hKey=" + hKey, e); } finally { if (subKey != null) { try { xfsConf.wfmCloseKey(subKey); } catch (XfsException e) { LOG.error(method, "Error closing subKey: " + subKey, e); } } } } return services; } RegistryServiceLookup(); Map<String, XfsServiceClass> lookup();  }
@Test public void test() { final Map<String, XfsServiceClass> services = new RegistryServiceLookup() .lookup(); for (Map.Entry<String, XfsServiceClass> service : services.entrySet()) { System.out.println(service.getKey() + ": " + service.getValue()); } }