private void initializeDirectives(DirectiveType type, Map<DirectiveType, ? extends Collection<String>> directives) {
    HashSet<String> requestDirectives = new HashSet<>();

    if ((directives != null) && directives.get(type) != null) {
      requestDirectives.addAll(directives.get(type));
    }

    this.directives.put(type, requestDirectives);
  }
Initializes the specified collection of directives into a modifiable set of directives for the specified type of directives.

@param type       a request type
@param directives the map of directives from which to copy
ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java