### Question:
JDBCGroupDatabase implements GroupDatabase { @Override public Group[] groups() throws WikiSecurityException { final Set<Group> groups = new HashSet<>(); Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { conn = m_ds.getConnection(); ps = conn.prepareStatement( m_findAll ); rs = ps.executeQuery(); while ( rs.next() ) { final String groupName = rs.getString( m_name ); if( groupName == null ) { log.warn( "Detected null group name in JDBCGroupDataBase. Check your group database." ); } else { final Group group = new Group( groupName, m_engine.getApplicationName() ); group.setCreated( rs.getTimestamp( m_created ) ); group.setCreator( rs.getString( m_creator ) ); group.setLastModified( rs.getTimestamp( m_modified ) ); group.setModifier( rs.getString( m_modifier ) ); populateGroup( group ); groups.add( group ); } } } catch( final SQLException e ) { closeQuietly( conn, ps, rs ); throw new WikiSecurityException( e.getMessage(), e ); } finally { closeQuietly( conn, ps, rs ); } return groups.toArray( new Group[groups.size()] ); }  @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 testGroups() throws WikiSecurityException { Group[] groups = m_db.groups(); Assertions.assertEquals( 4, groups.length ); Group group; group = backendGroup( "TV" ); Assertions.assertEquals("TV", group.getName() ); Assertions.assertEquals( 3, group.members().length ); group = backendGroup( "Literature" ); Assertions.assertEquals("Literature", group.getName() ); Assertions.assertEquals( 2, group.members().length ); group = backendGroup( "Art" ); Assertions.assertEquals("Art", group.getName() ); Assertions.assertEquals( 0, group.members().length ); group = backendGroup( "Admin" ); Assertions.assertEquals("Admin", group.getName() ); Assertions.assertEquals( 1, group.members().length ); Assertions.assertEquals( "Administrator", group.members()[0].getName() ); try { group = backendGroup( "Archaeology" ); Assertions.assertTrue(false); } catch (NoSuchPrincipalException e) { Assertions.assertTrue(true); } }