code: public static void discardStateFuture(RunnableFuture<? extends StateObject> stateFuture) throws Exception {
  		if (null != stateFuture) {
  			if (!stateFuture.cancel(true)) {
  
  				try {
  					// We attempt to get a result, in case the future completed before cancellation.
  					StateObject stateObject = FutureUtils.runIfNotDoneAndGet(stateFuture);
  
  					if (null != stateObject) {
  						stateObject.discardState();
  					}
  				} catch (CancellationException | ExecutionException ex) {
  					LOG.debug("Cancelled execution of snapshot future runnable. Cancellation produced the following " +
  						"exception, which is expected an can be ignored.", ex);
  				}
  			}
  		}
  	}
docs: Discards the given state future by first trying to cancel it. If this is not possible, then
  the state object contained in the future is calculated and afterwards discarded.
  
  @param stateFuture to be discarded
  @throws Exception if the discard operation failed