question: public void test_doAs_01 ( ) { Subject subj = new Subject ( ) ; PrivilegedAction < Object > pa = new myPrivilegedAction ( ) ; PrivilegedAction < Object > paNull = null ; try { Object obj = Subject . doAs ( null , pa ) ; } catch ( Exception e ) { fail ( "Unexpected exception: " + e ) ; } try { Object obj = Subject . doAs ( subj , pa ) ; } catch ( Exception e ) { fail ( "Unexpected exception: " + e ) ; } try { Object obj = Subject . doAs ( subj , paNull ) ; fail ( "NullPointerException wasn't thrown" ) ; } catch ( NullPointerException npe ) { } }
target:  javax.security.auth.Subject#doAs(Subject subject, PrivilegedAction action)