code: public void startForegroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) {
          stopForegroundIconRotateAnimation();
          foregroundRotateAnimation = Animations.createRotateTransition(foregroundIcon, fromAngle, toAngle, cycleCount, duration, interpolator, autoReverse);
          foregroundRotateAnimation.setOnFinished(event -> foregroundIcon.setRotate(0));
          foregroundRotateAnimation.play();
      }
docs: Method starts the rotate animation of the foreground icon.
  
  @param fromAngle    the rotation angle where the transition should start.
  @param toAngle      the rotation angle where the transition should end.
  @param cycleCount   the number of times the animation should be played (use Animation.INDEFINITE for endless).
  @param duration     the duration which one animation cycle should take.
  @param interpolator defines the rotation value interpolation between {@code fromAngle} and {@code toAngle}.
  @param autoReverse  defines if the animation should be reversed at the end.