public void remove(ApplicationId applicationId) {
        Set<DomainName> hostnames = hostnamesById.remove(applicationId);
        if (hostnames != null) {
            hostnames.forEach(idsByHostname::remove);
        }

        ApplicationInfo application = applicationsById.remove(applicationId);
        if (application != null) {
            logger.log(Level.FINE, () -> "Removed application " + applicationId.toFullString());
            listeners.forEach(listener -> listener.applicationRemoved(applicationId));
        }
    }
Note: Returns an empty set for unknown application.
service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModel.java