### Question:
DiscoveryNodeManager implements InternalNodeManager { @Override public synchronized AllNodes getAllNodes() { return allNodes; } @Inject  DiscoveryNodeManager(
            @ServiceType("presto") ServiceSelector serviceSelector,
            NodeInfo nodeInfo,
            FailureDetector failureDetector,
            NodeVersion expectedNodeVersion,
            @ForNodeManager HttpClient httpClient,
            InternalCommunicationConfig internalCommunicationConfig); @PostConstruct void startPollingNodeStates(); @PreDestroy void stop(); @Override void refreshNodes(); @Override synchronized AllNodes getAllNodes(); @Managed int getActiveNodeCount(); @Managed int getInactiveNodeCount(); @Managed int getShuttingDownNodeCount(); @Override Set<InternalNode> getNodes(NodeState state); @Override synchronized Set<InternalNode> getActiveConnectorNodes(CatalogName catalogName); @Override InternalNode getCurrentNode(); @Override synchronized Set<InternalNode> getCoordinators(); @Override synchronized void addNodeChangeListener(Consumer<AllNodes> listener); @Override synchronized void removeNodeChangeListener(Consumer<AllNodes> listener);  }### Answer:
@Test public void testGetAllNodes() { DiscoveryNodeManager manager = new DiscoveryNodeManager(selector, nodeInfo, new NoOpFailureDetector(), expectedVersion, testHttpClient, internalCommunicationConfig); try { AllNodes allNodes = manager.getAllNodes(); Set<InternalNode> activeNodes = allNodes.getActiveNodes(); assertEqualsIgnoreOrder(activeNodes, this.activeNodes); for (InternalNode actual : activeNodes) { for (InternalNode expected : this.activeNodes) { assertNotSame(actual, expected); } } assertEqualsIgnoreOrder(activeNodes, manager.getNodes(ACTIVE)); Set<InternalNode> inactiveNodes = allNodes.getInactiveNodes(); assertEqualsIgnoreOrder(inactiveNodes, this.inactiveNodes); for (InternalNode actual : inactiveNodes) { for (InternalNode expected : this.inactiveNodes) { assertNotSame(actual, expected); } } assertEqualsIgnoreOrder(inactiveNodes, manager.getNodes(INACTIVE)); } finally { manager.stop(); } }