### Question:
BlueprintConfigurationProcessor { Collection<Map<String, Map<String, PropertyUpdater>>> createCollectionOfUpdaters() { Collection<Map<String, Map<String, PropertyUpdater>>> updaters = allUpdaters; if (clusterTopology.isNameNodeHAEnabled()) { updaters = addNameNodeHAUpdaters(updaters); } if (clusterTopology.isYarnResourceManagerHAEnabled()) { updaters = addYarnResourceManagerHAUpdaters(updaters); } if (isOozieServerHAEnabled(clusterTopology.getConfiguration().getFullProperties())) { updaters = addOozieServerHAUpdaters(updaters); } return updaters; } BlueprintConfigurationProcessor(ClusterTopology clusterTopology); Map<String, Map<String, PropertyUpdater>> getRemovePropertyUpdaters(); void initRemovePropertyUpdaters(); Set<String> getRequiredHostGroups(); Set<String> doUpdateForClusterCreate(); void doUpdateForBlueprintExport(); void doNameNodeHAUpdate(); void doYarnResourceManagerHAUpdate(); void doOozieServerHAUpdate(); static final Map<String, Set<String>> TEMPORARY_PROPERTIES_FOR_CLUSTER_DEPLOYMENT; }### Answer:
@Test public void testDoUpdateForClusterCreate_OnlyOneUpdaterForEachProperty() throws Exception { BlueprintConfigurationProcessor bpConfigProcessor = new BlueprintConfigurationProcessor( createClusterTopology(bp, new Configuration(emptyMap(), emptyMap()), emptyList())); Collection<Map<String, Map<String, BlueprintConfigurationProcessor.PropertyUpdater>>> updaters = bpConfigProcessor.createCollectionOfUpdaters(); List<Pair<String, String>> propertiesWithUpdaters = updaters.stream(). flatMap(map -> map.entrySet().stream()). flatMap(entry -> { String configType = entry.getKey(); return entry.getValue().keySet().stream().map(propertyName -> Pair.of(configType, propertyName)); }). sorted(). collect(toList()); Set<Pair<String, String>> duplicates = new HashSet<>(); for (PeekingIterator<Pair<String, String>> it = peekingIterator(propertiesWithUpdaters.iterator()); it.hasNext(); ) { Pair<String, String> property = it.next(); if (it.hasNext() && it.peek().equals(property)) { duplicates.add(property); } } assertTrue("There are properties with multiple updaters: " + duplicates, duplicates.isEmpty()); }