public void testDoNotModifyPrincipalsIfNotOwner() {
Mock ownable = mock(Ownable.class);
ownable.expects(once()).method("getOwner").will(returnValue(new Principal("NotOwner")));
AccessContext context = new OwnerAccessContext((Ownable) ownable.proxy());
Set principals = new HashSet();
principals.add(new Principal("TestOwner"));
context.modifyPrincipals(principals);
assertTrue("Owner principal was not added to list.",
!principals.contains(new Principal("Owner")));
}