static <S, T> Map<S, T> mergeDisjunctMaps(Map<? extends S, ? extends T> map1, Map<? extends S, ? extends T> map2) {
    Sets.SetView<? extends S> commonKeys = Sets.intersection(map1.keySet(), map2.keySet());
    checkArgument(commonKeys.isEmpty(), "Maps must be disjunct. Common keys: %s", commonKeys);
    Map<S, T> merged = new HashMap<>(map1);
    merged.putAll(map2);
    return merged;
  }
Extracts a [component -> hosts] map from the [service -> component -> hosts] map. Services
with empty component map will be ignored
@param serviceComponentHostMap the input map
@return the extracted map
ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/StackAdvisorAdapter.java