### Question:
CmTemplateProcessor implements BlueprintTextProcessor { @Override public Set<String> getComponentsInHostGroup(String name) { return getComponentsByHostGroup().getOrDefault(name, Set.of()); } CmTemplateProcessor(@Nonnull String cmTemplateText); @Override ClusterManagerType getClusterManagerType(); @Override BlueprintTextProcessor replaceConfiguration(String s, String descriptor); @Override BlueprintTextProcessor addComponentToHostgroups(String component, Predicate<String> addToHostgroup); @Override boolean isComponentExistsInHostGroup(String component, String hostGroup); @Override BlueprintTextProcessor addComponentToHostgroups(String component, Collection<String> addToHostGroups); @Override Set<String> getHostGroupsWithComponent(String component); @Override String asText(); @Override BlueprintTextProcessor setSecurityType(String kerberos); @Override BlueprintTextProcessor extendBlueprintGlobalConfiguration(SiteConfigurations configs, boolean forced); @Override Set<String> getComponentsInHostGroup(String name); @Override Set<String> getImpalaCoordinatorsInHostGroup(String name); @Override BlueprintTextProcessor extendBlueprintHostGroupConfiguration(HostgroupConfigurations hostgroupConfigurations, boolean b); @Override Map<String, InstanceCount> getCardinalityByHostGroup(); Map<String, Set<ServiceComponent>> getServiceComponentsByHostGroup(); @Override String getHostGroupPropertyIdentifier(); @Override Optional<String> getVersion(); Optional<String> getCmVersion(); @Override Map<String, Set<String>> getNonGatewayComponentsByHostGroup(); @Override Map<String, Set<String>> getComponentsByHostGroup(); @Override GatewayRecommendation recommendGateway(); @Override AutoscaleRecommendation recommendAutoscale(); @Override ResizeRecommendation recommendResize(); @Override String getStackVersion(); @Override List<String> getHostTemplateNames(); Set<ServiceComponent> getAllComponents(); void addInstantiator(ClouderaManagerRepo clouderaManagerRepoDetails, TemplatePreparationObject templatePreparationObject, String sdxContextName); void addVariables(List<ApiClusterTemplateVariable> vars); void extendTemplateWithAdditionalServices(Map<String, ApiClusterTemplateService> hostGroupServices); void addServiceConfigs(String serviceType, List<String> roleTypes, List<ApiClusterTemplateConfig> configs); void mergeServiceConfigs(ApiClusterTemplateService service, List<ApiClusterTemplateConfig> newConfigs); Map<String, ApiClusterTemplateConfig> mapByName(Collection<ApiClusterTemplateConfig> configs); void addRoleConfigs(String serviceType, Map<String, List<ApiClusterTemplateConfig>> newConfigMap); void mergeRoleConfigs(ApiClusterTemplateRoleConfigGroup configGroup, List<ApiClusterTemplateConfig> newConfigs); boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes); Optional<ApiClusterTemplateService> getServiceByType(String serviceType); ApiClusterTemplate getTemplate(); void addHosts(Map<String, List<Map<String, String>>> hostGroupMappings); void resetProducts(); void resetRepositories(); void addProduct(String product, String version); void addRepositoryItem(String repositoriesItem); void setCmVersion(String cmVersion); void setCdhVersion(String cdhVersion); void setDisplayName(String displayName); void setHostTemplates(List<ApiClusterTemplateHostTemplate> hostTemplates); void setServices(List<ApiClusterTemplateService> services); void addDiagnosticTags(TemplatePreparationObject templatePreparationObject, ClouderaManagerRepo clouderaManagerRepo); void removeDanglingVariableReferences(); boolean isCMComponentExistsInBlueprint(String component); Optional<ApiClusterTemplateConfig> getRoleConfig(String serviceType, String roleType, String configName);  }### Answer:
@Test public void testGetComponentsInHostGroup() { underTest = new CmTemplateProcessor(getBlueprintText("input/clouderamanager.bp")); Set<String> expected = Set.of("REGIONSERVER", "DATANODE", "GATEWAY", "IMPALAD", "NODEMANAGER"); Set<String> actual = underTest.getComponentsInHostGroup("worker"); assertSortedEquals(expected, actual); }