### Question:
ClusterTopologyImpl implements ClusterTopology { @Override public void removeHost(String hostname) { for(Map.Entry<String,HostGroupInfo> entry : hostGroupInfoMap.entrySet()) { entry.getValue().removeHost(hostname); } } ClusterTopologyImpl(AmbariContext ambariContext, TopologyRequest topologyRequest); @Override void update(TopologyRequest topologyRequest); @Override Long getClusterId(); @Override void setClusterId(Long clusterId); @Override Blueprint getBlueprint(); @Override Configuration getConfiguration(); @Override Map<String, HostGroupInfo> getHostGroupInfo(); @Override Collection<String> getHostGroupsForComponent(String component); @Override String getHostGroupForHost(String hostname); @Override void addHostToTopology(String hostGroupName, String host); @Override Collection<String> getHostAssignmentsForComponent(String component); @Override boolean isNameNodeHAEnabled(); static boolean isNameNodeHAEnabled(Map<String, Map<String, String>> configurationProperties); @Override boolean isYarnResourceManagerHAEnabled(); @Override boolean isClusterKerberosEnabled(); @Override RequestStatusResponse installHost(String hostName, boolean skipInstallTaskCreate, boolean skipFailure); @Override RequestStatusResponse startHost(String hostName, boolean skipFailure); @Override void setConfigRecommendationStrategy(ConfigRecommendationStrategy strategy); @Override ConfigRecommendationStrategy getConfigRecommendationStrategy(); @Override ProvisionAction getProvisionAction(); @Override void setProvisionAction(ProvisionAction provisionAction); @Override Map<String, AdvisedConfiguration> getAdvisedConfigurations(); @Override AmbariContext getAmbariContext(); @Override void removeHost(String hostname); @Override String getDefaultPassword(); @Override boolean hasHadoopCompatibleService();  }### Answer:
@Test(expected = InvalidTopologyException.class) public void testCreate_NNHAInvaid() throws Exception { bpconfiguration.setProperty("hdfs-site", "dfs.nameservices", "val"); expect(group4.getName()).andReturn("group4"); hostGroupInfoMap.get("group4").removeHost("host5"); TestTopologyRequest request = new TestTopologyRequest(TopologyRequest.Type.PROVISION); replayAll(); new ClusterTopologyImpl(null, request); hostGroupInfoMap.get("group4").addHost("host5"); }