@Test
public void test(){
DefaultSecurityManager defaultSecurityManager=new DefaultSecurityManager();
SimpleAccountRealm simpleAccountRealm=new SimpleAccountRealm();
simpleAccountRealm.addAccount("chen","123");
simpleAccountRealm.addAccount("li","123");
defaultSecurityManager.setRealm(simpleAccountRealm);
SecurityUtils.setSecurityManager(defaultSecurityManager);
Subject subject=SecurityUtils.getSubject();
UsernamePasswordToken usernamePasswordToken=new UsernamePasswordToken("chen","123");
UsernamePasswordToken usernamePasswordToken1=new UsernamePasswordToken("li","123");
subject.login(usernamePasswordToken);
subject.login(usernamePasswordToken1);
System.out.println(subject.isAuthenticated());
subject.logout();
System.out.println(subject.isAuthenticated());
}