### Question:
XMLGroupDatabase implements GroupDatabase { @Override public void save( final Group group, final Principal modifier ) throws WikiSecurityException { if ( group == null || modifier == null ) { throw new IllegalArgumentException( "Group or modifier cannot be null." ); } checkForRefresh(); final String index = group.getName(); final boolean isNew = !( m_groups.containsKey( index ) ); final Date modDate = new Date( System.currentTimeMillis() ); if ( isNew ) { group.setCreated( modDate ); group.setCreator( modifier.getName() ); } group.setModifier( modifier.getName() ); group.setLastModified( modDate ); m_groups.put( index, group ); saveDOM(); }  @Override void delete( final Group group ); @Override Group[] groups(); @Override void initialize( final Engine engine, final Properties props ); @Override void save( final Group group, final Principal modifier ); static final String PROP_DATABASE; }### Answer:
@Test public void testSave() throws Exception { String name = "TestGroup" + String.valueOf( System.currentTimeMillis() ); Group group = new Group( name, m_wiki ); Principal al = new WikiPrincipal( "Al" ); Principal bob = new WikiPrincipal( "Bob" ); Principal cookie = new WikiPrincipal( "Cookie" ); group.add( al ); group.add( bob ); group.add( cookie ); m_db.save(group, new WikiPrincipal( "Tester" ) ); group = backendGroup( name ); Assertions.assertEquals( name, group.getName() ); Assertions.assertEquals( 3, group.members().length ); Assertions.assertTrue( group.isMember( new WikiPrincipal( "Al" ) ) ); Assertions.assertTrue( group.isMember( new WikiPrincipal( "Bob" ) ) ); Assertions.assertTrue( group.isMember( new WikiPrincipal( "Cookie" ) ) ); Assertions.assertNotNull( group.getCreator() ); Assertions.assertEquals( "Tester", group.getCreator() ); Assertions.assertNotNull( group.getCreated() ); Assertions.assertNotNull( group.getModifier() ); Assertions.assertEquals( "Tester", group.getModifier() ); Assertions.assertNotNull( group.getLastModified() ); Assertions.assertNotSame( group.getCreated(), group.getLastModified() ); m_db.delete( group ); }