StepUtils { public static Set<DataStep> getDataSteps(Set<Step> steps) { Set<DataStep> dataSteps = Sets.newHashSet(); for (Step step : steps) { if (step instanceof DataStep) { dataSteps.add((DataStep)step); } } return dataSteps; }  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 testGetDataSteps() { Step step1 = new BatchStep("step1"); Step step2 = new StreamingStep("step2"); Step step3 = new LoopStep("step3"); step1.configure(ConfigFactory.empty()); step2.configure(ConfigFactory.empty().withValue("input.translator", ConfigFactory.empty().root())); step3.configure(ConfigFactory.empty()); Set<Step> steps = Sets.<Step>newHashSet(step1, step2, step3); assertEquals(StepUtils.getDataSteps(steps), Sets.newHashSet(step1, step2)); }