title: How do I set the AccessControlContext in Java?
body: <p>I'm fairly new to Java security stuff and I'm having a hard time figuring out how to google the right answer to this.</p>
  
  <p>I have a line of code that reads <code>AccessController.getContext()</code>.  </p>
  
  <p>I want to run a test where I mock the result of this.  Unfortunately, I have no idea what I'm doing.  </p>
  
  <p>How do I set the <code>AccessControlContext</code> returned by <code>AccessController.getContext()</code>?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Just to clarify, I know how to mock interfaces.  AccessController is a Java security feature.  I'm having trouble finding out how to set my own context so that when a method calls <code>AccessController.getContext()</code> it returns a AccessControlContext of my choosing.</p>