class AnimationTimerTask extends TimerTask {
        private final WeakReference<AnimatedLabel> labelRef;

        private AnimationTimerTask(AnimatedLabel label) {
            this.labelRef = new WeakReference<>(label);
        }

        @Override
        public void run() {<FILL_FUNCTION_BODY>}
    }

            AnimatedLabel animatedLabel = labelRef.get();
            if(animatedLabel == null) {
                cancel();
                canCloseTimer();
            }
            else {
                if(animatedLabel.getBasePane() == null) {
                    animatedLabel.stopAnimation();
                }
                else {
                    animatedLabel.nextFrame();
                }
            }
        
<methods>public void <init>(java.lang.String) ,public synchronized com.googlecode.lanterna.gui2.Label addStyle(com.googlecode.lanterna.SGR) ,public com.googlecode.lanterna.TextColor getBackgroundColor() ,public com.googlecode.lanterna.TextColor getForegroundColor() ,public java.lang.Integer getLabelWidth() ,public synchronized java.lang.String getText() ,public synchronized com.googlecode.lanterna.gui2.Label removeStyle(com.googlecode.lanterna.SGR) ,public synchronized com.googlecode.lanterna.gui2.Label setBackgroundColor(com.googlecode.lanterna.TextColor) ,public synchronized com.googlecode.lanterna.gui2.Label setForegroundColor(com.googlecode.lanterna.TextColor) ,public synchronized com.googlecode.lanterna.gui2.Label setLabelWidth(java.lang.Integer) ,public synchronized void setText(java.lang.String) <variables>private final non-sealed EnumSet<com.googlecode.lanterna.SGR> additionalStyles,private com.googlecode.lanterna.TextColor backgroundColor,private com.googlecode.lanterna.TextColor foregroundColor,private com.googlecode.lanterna.TerminalSize labelSize,private java.lang.Integer labelWidth,private java.lang.String[] lines