code: @Deprecated
      public static void impersonate(@Nonnull Authentication auth, @Nonnull Runnable body) {
          SecurityContext old = impersonate(auth);
          try {
              body.run();
          } finally {
              SecurityContextHolder.setContext(old);
          }
      }
docs: Safer variant of {@link #impersonate(Authentication)} that does not require a finally-block.
  @param auth authentication, such as {@link #SYSTEM}
  @param body an action to run with this alternate authentication in effect
  @since 1.509
  @deprecated use try with resources and {@link #as(Authentication)}