class NodeManager {

    public synchronized List<NodeHandler> getNodes(Set<String> nodesInUse) {
        List<NodeHandler> handlers = new ArrayList<>();

        List<Node> foundNodes = this.peerExplorer.getNodes();
        if (this.discoveryEnabled && CollectionUtils.isNotEmpty(foundNodes)) {
            logger.debug("{} Nodes retrieved from the PE.", CollectionUtils.size(foundNodes));
            foundNodes.stream().filter(n -> !nodeHandlerMap.containsKey(n.getHexId())).forEach(this::createNodeHandler);
        }

        for(NodeHandler handler : this.nodeHandlerMap.values()) {
            if(!nodesInUse.contains(handler.getNode().getHexId())) {
                handlers.add(handler);
            }
        }
        return handlers;
    }

    @Autowired public  NodeManager(PeerExplorer peerExplorer, SystemProperties config);

}