Pipeline implements ConnectionValidator, SettingsProvider, StepIndexer { public final ImmutableList<Source> getSources() { return readSourcesSafely(ImmutableList::copyOf); }  void clear(); final ImmutableList<Source> getSources(); final ImmutableList<Step> getSteps(); Set<Connection> getConnections(); @Override ProjectSettings getProjectSettings(); @Override AppSettings getAppSettings(); @Override CodeGenerationSettings getCodeGenerationSettings(); @SuppressWarnings("unchecked") @Override boolean canConnect(OutputSocket<?> outputSocket, InputSocket<?> inputSocket); @Subscribe void onSourceAdded(SourceAddedEvent event); @Subscribe void onSourceRemoved(SourceRemovedEvent event); void addStepBetween(Step stepToAdd, @Nullable Step lower, @Nullable Step higher); void moveStepBetween(Step toMove, @Nullable Step lower, @Nullable Step higher); void addStep(int index, Step step); void addStep(Step step); void removeStep(Step step); synchronized void moveStep(Step step, int delta); @Override int indexOf(Step step); @Subscribe void onConnectionAdded(ConnectionAddedEvent event); @Subscribe void onConnectionRemoved(ConnectionRemovedEvent event); @Subscribe void onProjectSettingsChanged(ProjectSettingsChangedEvent event); @Subscribe void onAppSettingsChanged(AppSettingsChangedEvent event); @Subscribe void onCodeGenerationSettingsChanged(CodeGenerationSettingsChangedEvent event);  }
@Test public void testAddSource() throws URISyntaxException, IOException { Source source = new MockSource(); eventBus.post(new SourceAddedEvent(source)); assertEquals("The source was not added to the pipeline", Collections.singletonList(source), pipeline.getSources()); }
@Test public void testRemoveSource() throws URISyntaxException, IOException { Source source = new MockSource(); eventBus.post(new SourceAddedEvent(source)); eventBus.post(new SourceRemovedEvent(source)); assertEquals("The source was not added then removed from the pipeline", Collections.emptyList(), pipeline.getSources()); }