### Question:
JDBCGroupDatabase implements GroupDatabase { @Override public void delete( final Group group ) throws WikiSecurityException { if( !exists( group ) ) { throw new NoSuchPrincipalException( "Not in database: " + group.getName() ); } final String groupName = group.getName(); Connection conn = null; PreparedStatement ps = null; try { conn = m_ds.getConnection(); if( m_supportsCommits ) { conn.setAutoCommit( false ); } ps = conn.prepareStatement( m_deleteGroup ); ps.setString( 1, groupName ); ps.execute(); ps.close(); ps = conn.prepareStatement( m_deleteGroupMembers ); ps.setString( 1, groupName ); ps.execute(); if( m_supportsCommits ) { conn.commit(); } } catch( final SQLException e ) { closeQuietly( conn, ps, null ); throw new WikiSecurityException( "Could not delete group " + groupName + ": " + e.getMessage(), e ); } finally { closeQuietly( conn, ps, null ); } }  @Override void delete( final Group group ); @Override Group[] groups(); @Override void save( final Group group, final Principal modifier ); @Override void initialize( final Engine engine, final Properties props ); static final String DEFAULT_GROUPDB_DATASOURCE; static final String DEFAULT_GROUPDB_TABLE; static final String DEFAULT_GROUPDB_MEMBER_TABLE; static final String DEFAULT_GROUPDB_CREATED; static final String DEFAULT_GROUPDB_CREATOR; static final String DEFAULT_GROUPDB_NAME; static final String DEFAULT_GROUPDB_MEMBER; static final String DEFAULT_GROUPDB_MODIFIED; static final String DEFAULT_GROUPDB_MODIFIER; static final String PROP_GROUPDB_DATASOURCE; static final String PROP_GROUPDB_TABLE; static final String PROP_GROUPDB_MEMBER_TABLE; static final String PROP_GROUPDB_CREATED; static final String PROP_GROUPDB_CREATOR; static final String PROP_GROUPDB_NAME; static final String PROP_GROUPDB_MEMBER; static final String PROP_GROUPDB_MODIFIED; static final String PROP_GROUPDB_MODIFIER; }### Answer:
@Test public void testDelete() throws WikiException { int oldUserCount = m_db.groups().length; String name = "TestGroup" + String.valueOf( System.currentTimeMillis() ); Group group = new Group( name, m_wiki ); Principal al = new WikiPrincipal( "Al" ); Principal bob = new WikiPrincipal( "Bob" ); group.add( al ); group.add( bob ); m_db.save(group, new WikiPrincipal( "Tester") ); group = backendGroup( name ); Assertions.assertEquals( name, group.getName() ); Assertions.assertEquals( oldUserCount+1, m_db.groups().length ); m_db.delete( group ); Assertions.assertEquals( oldUserCount, m_db.groups().length ); }