}
private static Map<String, Double> loadAccounts(String resourceName) {
try {
// parse the accounts document
DocumentBuilder domBuilder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
URL resource = AccountSystem_Impl.class.getResource(resourceName);
if (resource == null) return Collections.emptyMap();
Document accountsDocument = domBuilder.parse(resource.toString());
// give everyone an initial balance of $50
Double initialBalance = new Double(50);
// iterate over the accounts
Map<String, Double> accounts = new HashMap<String, Double>();
Element accountsElem = accountsDocument.getDocumentElement();