### Question:
ClusterTopologyImpl implements ClusterTopology { @Override public Collection<String> getHostAssignmentsForComponent(String component) { Collection<String> hosts = new ArrayList<>(); Collection<String> hostGroups = getHostGroupsForComponent(component); for (String group : hostGroups) { HostGroupInfo hostGroupInfo = getHostGroupInfo().get(group); if (hostGroupInfo != null) { hosts.addAll(hostGroupInfo.getHostNames()); } else { LOG.warn("HostGroup {} not found, when checking for hosts for component {}", group, component); } } return hosts; } 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 public void test_GetHostAssigmentForComponents() throws Exception { TestTopologyRequest request = new TestTopologyRequest(TopologyRequest.Type.PROVISION); replayAll(); new ClusterTopologyImpl(null, request).getHostAssignmentsForComponent("component1"); }