### Question:
NetworkTopologyImpl implements NetworkTopology { public boolean contains(Node node) { Preconditions.checkArgument(node != null, "node cannot be null"); netlock.readLock().lock(); try { Node parent = node.getParent(); while (parent != null && parent != clusterTree) { parent = parent.getParent(); } if (parent == clusterTree) { return true; } } finally { netlock.readLock().unlock(); } return false; } NetworkTopologyImpl(ConfigurationSource conf); @VisibleForTesting  NetworkTopologyImpl(NodeSchemaManager manager); void add(Node node); void remove(Node node); boolean contains(Node node); boolean isSameAncestor(Node node1, Node node2, int ancestorGen); boolean isSameParent(Node node1, Node node2); Node getAncestor(Node node, int ancestorGen); Node getNode(String loc); int getNumOfLeafNode(String loc); int getMaxLevel(); int getNumOfNodes(int level); Node chooseRandom(String scope); Node chooseRandom(String scope, List<String> excludedScopes); Node chooseRandom(String scope, Collection<Node> excludedNodes); Node chooseRandom(String scope, Collection<Node> excludedNodes,
      int ancestorGen); Node chooseRandom(String scope, List<String> excludedScopes,
      Collection<Node> excludedNodes, Node affinityNode, int ancestorGen); Node getNode(int leafIndex, String scope, List<String> excludedScopes,
      Collection<Node> excludedNodes, Node affinityNode, int ancestorGen); int getDistanceCost(Node node1, Node node2); List<? extends Node> sortByDistanceCost(Node reader,
      List<? extends Node> nodes, int activeLen); @Override String toString(); static final Logger LOG; }### Answer:
@Test public void testContains() { Node nodeNotInMap = createDatanode("8.8.8.8", "/d2/r4"); for (int i=0; i < dataNodes.length; i++) { assertTrue(cluster.contains(dataNodes[i])); } assertFalse(cluster.contains(nodeNotInMap)); }