class DiscoveryFactory implements Discovery {

    public static Discovery provider() {

//        if(HOLDER.get() != null) {
//            return HOLDER.get();
//        }

        final NetworkStore networkStore = NetworkStore.getInstance();
        final RuntimeContext runtimeContext = RuntimeContext.getInstance();
        final Discovery discovery;
        if(runtimeContext.isDisablePeerDiscovery()) {
            final Set<NodeUri> knownNodes = runtimeContext.getPeers().stream()
                                        .map(NodeUri::create)
                                        .collect(Collectors.toUnmodifiableSet());
            discovery = new DisabledAutoDiscovery(networkStore,knownNodes);
        } else {
            discovery = new AutoDiscovery(networkStore);
        }

       // HOLDER.set(discovery);

        return discovery;
    }

    public  DiscoveryFactory();
    protected  DiscoveryFactory(Discovery discovery);

}