@Override
    public void unregisterApplication(ApplicationId appId) {
        if (localAppBundleDirectory.containsKey(appId)) {
            for (String location : localAppBundleDirectory.get(appId)) {
                if (localBundleAppDirectory.get(location).size() == 1) {
                    localBundleAppDirectory.remove(location);
                } else {
                    localBundleAppDirectory.get(location).remove(appId);
                }
            }
            localAppBundleDirectory.remove(appId);
        }
    }
@Test
    public void testUnregisterApplication() {
        if (localAppBundleDirectory.containsKey(appId)) {
            for (String location : localAppBundleDirectory.get(appId)) {
                if (localBundleAppDirectory.get(location) != null) {
                    if (localBundleAppDirectory.get(location).size() == 1) {
                        localBundleAppDirectory.remove(location);
                    } else {
                        localBundleAppDirectory.get(location).remove(appId);
                    }
                }
            }
            localAppBundleDirectory.remove(appId);
        }
        assertNull(localAppBundleDirectory.get(appId));
    }