private void handleAppFinishEvent(DelegationTokenRenewerEvent evt) {
   if (!tokenKeepAliveEnabled) {
     removeApplicationFromRenewal(evt.getApplicationId());
   } else {
     delayedRemovalMap.put(
         evt.getApplicationId(), System.currentTimeMillis() + tokenRemovalDelayMs);
   }
 }
 @Override
 public void run() {
   if (evt instanceof DelegationTokenRenewerAppSubmitEvent) {
     DelegationTokenRenewerAppSubmitEvent appSubmitEvt =
         (DelegationTokenRenewerAppSubmitEvent) evt;
     handleDTRenewerAppSubmitEvent(appSubmitEvt);
   } else if (evt.getType().equals(DelegationTokenRenewerEventType.FINISH_APPLICATION)) {
     DelegationTokenRenewer.this.handleAppFinishEvent(evt);
   }
 }