private static <T> void classifyItem(ProvisionAction action, T item, Map<ProvisionStep, List<T>> itemsByStep) {
    for (ProvisionStep step : action.getSteps()) {
      itemsByStep.computeIfAbsent(step, __ -> new LinkedList<>()).add(item);
    }
  }
Adds {@code item} to the list(s) it belongs to depending on {@code action}'s steps.
For example if {@code action} is {@link ProvisionAction#INSTALL_AND_START}, then the
{@code item} is added to both {@link ProvisionStep#INSTALL} and {@link ProvisionStep#START}
lists, but not to the list for {@link ProvisionStep#SKIP_INSTALL}.

@param action provision action
@param item the item to add
@param itemsByStep step -> list of items
ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ProvisionActionPredicateBuilder.java