BranchPerformer implements StepPerformer, FlowerSelectedListener { public static BranchPerformer newInstance(InkDrop inkDrop, RainbowDrawer rainbowDrawer, RainbowInputController rainbowInputController) { BrushOptionsPreferences brushOptionsPreferences = BrushOptionsPreferences.newInstance(); BranchesList branchesList = BranchesList.newInstance(); FlowerOptionPreferences flowerOptionPreferences = FlowerOptionPreferences.newInstance(); Flower flower = flowerOptionPreferences.getFlower(); FlowerDrawer flowerDrawer = FlowerDrawer.newInstance(flower, rainbowDrawer); return new BranchPerformer(inkDrop, branchesList, flowerDrawer, new PaintStepSkipper(), brushOptionsPreferences, rainbowDrawer, rainbowInputController); } protected  BranchPerformer(InkDrop inkDrop,
                              BranchesList branchesList,
                              FlowerDrawer flowerDrawer,
                              PaintStepSkipper paintStepSkipper,
                              BrushOptionsPreferences brushOptionsPreferences,
                              RainbowDrawer rainbowDrawer,
                              RainbowInputController rainbowInputController); static BranchPerformer newInstance(InkDrop inkDrop,
                                              RainbowDrawer rainbowDrawer,
                                              RainbowInputController rainbowInputController); @Override void init(); @Override void doStep(); @Override void enable(); @Override void disable(); @Override void reset(); @Override void onFlowerSelected(final Flower flower);  }
@Test public void testThatNewInstanceReturnsNotNullBranchPerformer() { assertThat(BranchPerformer.newInstance(inkDrop, rainbowDrawer, rainbowInputController)).isNotNull(); }
@Test public void testThatNewInstanceReturnsANewInstance() { BranchPerformer firstInstance = BranchPerformer.newInstance(inkDrop, rainbowDrawer, rainbowInputController); BranchPerformer secondInstance = BranchPerformer.newInstance(inkDrop, rainbowDrawer, rainbowInputController); assertThat(firstInstance).isNotEqualTo(secondInstance); }