code: public static ListeningScheduledExecutorService listeningDecorator(
        ScheduledExecutorService delegate) {
      return (delegate instanceof ListeningScheduledExecutorService)
          ? (ListeningScheduledExecutorService) delegate
          : new ScheduledListeningDecorator(delegate);
    }
docs: Creates a {@link ScheduledExecutorService} whose {@code submit} and {@code
  invokeAll} methods submit {@link ListenableFutureTask} instances to the
  given delegate executor. Those methods, as well as {@code execute} and
  {@code invokeAny}, are implemented in terms of calls to {@code
  delegate.execute}. All other methods are forwarded unchanged to the
  delegate. This implies that the returned {@code
  ListeningScheduledExecutorService} never calls the delegate's {@code
  submit}, {@code invokeAll}, and {@code invokeAny} methods, so any special
  handling of tasks must be implemented in the delegate's {@code execute}
  method or by wrapping the returned {@code
  ListeningScheduledExecutorService}.
  
  <p>If the delegate executor was already an instance of {@code
  ListeningScheduledExecutorService}, it is returned untouched, and the rest
  of this documentation does not apply.
  
  @since 10.0