@Test
void testRemoveUser() {

    TestWebApplicationRequest request = new TestWebApplicationRequest();
    request.setUserPrincipal(new UserPrincipal("username"));
    DefaultSecurityManager securityManager = new DefaultSecurityManager();
    securityManager.addUser("username", "password", new String[]{"role1", "role2"});
    assertTrue(securityManager.isUserInRole(request, "role1"));
    securityManager.removeUser("username");
    assertFalse(securityManager.isUserInRole(request, "role1"));
}