class EurekaServiceDiscovery extends AbstractServiceDiscovery {

    @Override
    public Set<String> getServices() {
        Applications applications = this.eurekaClient.getApplications();
        if (applications == null) {
            return Collections.emptySet();
        }
        List<Application> registered = applications.getRegisteredApplications();
        Set<String> names = new LinkedHashSet<>();
        for (Application app : registered) {
            if (app.getInstances().isEmpty()) {
                continue;
            }
            names.add(app.getName().toLowerCase());
        }
        return names;
    }

}