### Question:
StaticClusterManager implements ClusterMap { @Override public boolean hasDatacenter(String datacenterName) { return hardwareLayout.findDatacenter(datacenterName) != null; } StaticClusterManager(PartitionLayout partitionLayout, String localDatacenterName, MetricRegistry metricRegistry); @Override List<PartitionId> getWritablePartitionIds(String partitionClass); @Override PartitionId getRandomWritablePartition(String partitionClass, List<PartitionId> partitionsToExclude); @Override List<PartitionId> getAllPartitionIds(String partitionClass); @Override PartitionId getPartitionIdFromStream(InputStream stream); @Override boolean hasDatacenter(String datacenterName); @Override byte getLocalDatacenterId(); @Override String getDatacenterName(byte id); @Override DataNodeId getDataNodeId(String hostname, int port); @Override List<ReplicaId> getReplicaIds(DataNodeId dataNodeId); @Override List<DataNodeId> getDataNodeIds(); @Override MetricRegistry getMetricRegistry(); @Override void registerClusterMapListener(ClusterMapChangeListener clusterMapChangeListener); @Override boolean equals(Object o); @Override void onReplicaEvent(ReplicaId replicaId, ReplicaEventType event); @Override JSONObject getSnapshot(); @Override ReplicaId getBootstrapReplica(String partitionIdStr, DataNodeId dataNodeId); @Override void close();  }### Answer:
@Test public void findDatacenter() { TestHardwareLayout testHardwareLayout = new TestHardwareLayout("Alpha"); TestPartitionLayout testPartitionLayout = new TestPartitionLayout(testHardwareLayout, null); StaticClusterManager clusterMapManager = (new StaticClusterAgentsFactory(getDummyConfig(), testPartitionLayout.getPartitionLayout())).getClusterMap(); for (Datacenter datacenter : testHardwareLayout.getHardwareLayout().getDatacenters()) { assertTrue(clusterMapManager.hasDatacenter(datacenter.getName())); assertFalse(clusterMapManager.hasDatacenter(datacenter.getName() + datacenter.getName())); } }