SketchInteractionListener implements RainbowInputController.RainbowInteractionListener { @Override public void onSketchReleased(MotionEvent event) { if (hasPaintListener()) { paintListener.onPaintingStop(); } } SketchInteractionListener(StepPerformer inkPerformer); static SketchInteractionListener newInstance(StepPerformer inkPerformer); @Override void onSketchTouched(MotionEvent event); @Override void onSketchReleased(MotionEvent event); @Override void onFingerDragged(MotionEvent event); @Override void onMotionEvent(MotionEvent event); void setPaintListener(ZenSketch.PaintListener paintListener);  }
@Test public void testThatIfHaveOnPaintingListenerThenOnScreenReleasedFiresOnPaintingEnd() { givenThatHasPaintingListener(); sketchInteractionListener.onSketchReleased(motionEvent); verify(listener).onPaintingStop(); }
@Test public void testThatIfDoesNotHaveOnPaintingListenerThenOnScreenReleasedDoesNotFireOnPaintingEnd() { sketchInteractionListener.onSketchReleased(motionEvent); verify(listener, never()).onPaintingStop(); }