private DeploymentActionsCompleteBuilder undeployAndRemoveUndeployed(
final DeploymentPlanBuilder builder, final List<String> deploymentNames) {
DeploymentActionsCompleteBuilder completeBuilder = null;
for (String deploymentName : deploymentNames) {
DeploymentPlanBuilder actualBuilder = (completeBuilder == null ? builder : completeBuilder);
completeBuilder = actualBuilder.undeploy(deploymentName).andRemoveUndeployed();
if (matchPatternStrategy == MatchPatternStrategy.FIRST) {
break;
}
}