I'm attempting to extend a class in order to polymorphically run its functions as privileged. I want to avoid modifying the base class, Fooer in the example, and I definitely want to avoid reflection. I've been working mainly with javascript and python lately so my mind keeps repeating, "Use a function pointer" but since functions are not first class objects in java that is not an option. This seems like a valid goal so I'm assuming someone know a good design pattern for this that I'm missing.
public class SecureFooer extends Fooer()
{
    @Override
    public Object foo()
    {
        PrivilegedAction<Object> action = new PrivilegedAction<Object>() {
            @Override
            public Object run() {
                // This isn't going to work, i'm inside PrivilegedAction
                return super.foo()
            }
        };
        return AccessController.doPrivileged(action);
    }
}
 
    