StepUtils { public static String stepNamesAsString(Set<? extends Step> steps) { StringBuilder sb = new StringBuilder(); for (Step step : steps) { sb.append(step.getName()); sb.append(", "); } if (sb.length() > 0) { sb.setLength(sb.length() - ", ".length()); } return sb.toString(); }  static boolean allStepsSubmitted(Set<Step> steps); static boolean allStepsFinished(Set<Step> steps); static Set<Step> getDependencies(Step step, Set<Step> steps); static boolean hasStreamingStep(Set<Step> steps); static Set<StreamingStep> getStreamingSteps(Set<Step> steps); static Set<Step> getAllDependentSteps(Step rootStep, Set<Step> steps); static Set<Step> getImmediateDependentSteps(Step step, Set<Step> steps); static Set<Step> getIndependentNonStreamingSteps(Set<Step> steps); static String stepNamesAsString(Set<? extends Step> steps); static void resetSteps(Set<Step> steps); static void resetRepeatingSteps(Set<Step> allSteps); static Set<DataStep> getDataSteps(Set<Step> steps); static Optional<Step> getStepForName(String name, Set<Step> steps); static Set<Step> copySteps(Set<Step> steps); static Map<String, Dataset<Row>> getStepDataFrames(Set<Step> steps); static Set<Step> extractSteps(Config config, boolean configure, boolean notify); static Set<Step> mergeLoadedSteps(Set<Step> baseSteps, Step parentStep, Config baseConfig); static Map<String, StepState> getStepStates(Set<Step> steps); static Set<Step> getStepsMatchingState(Set<Step> steps, StepState matching);  }
@Test public void testStepNamesAsString() { Step step1 = new BatchStep("step1"); Step step2 = new BatchStep("step2"); Step step3 = new BatchStep("step3"); step1.configure(ConfigFactory.empty()); step2.configure(ConfigFactory.empty()); step3.configure(ConfigFactory.empty()); Set<Step> steps = Sets.newHashSet(step1, step2, step3); assertTrue(StepUtils.stepNamesAsString(steps).equals("step1, step2, step3") || StepUtils.stepNamesAsString(steps).equals("step1, step3, step2") || StepUtils.stepNamesAsString(steps).equals("step2, step1, step3") || StepUtils.stepNamesAsString(steps).equals("step2, step3, step1") || StepUtils.stepNamesAsString(steps).equals("step3, step1, step2") || StepUtils.stepNamesAsString(steps).equals("step3, step2, step1")); }