container-common/src/main/java/com/streamsets/datacollector/security/SecurityUtil.java
public static <T> T doAs(
      final Subject subject, final PrivilegedAction<T> privilegedAction
  ) {
    checkDoAsPermission();
    if (privilegedAction == null) {
      throw new RuntimeException("No privileged action provided");
    }
    return AccessController.doPrivileged(privilegedAction, createContext(subject, AccessController.getContext()));
  }
public static <T> T doAs(
      final Subject subject, final PrivilegedAction<T> privilegedAction
  ) {
    checkDoAsPermission();
    if (privilegedAction == null) {
      throw new RuntimeException("No privileged action provided");
    }
    return AccessController.doPrivileged(privilegedAction, createContext(subject, AccessController.getContext()));
  }
Influenced by javax.security.auth.Subject.#doAs