Attributes entry = ( Attributes ) ( ( Attributes ) i.next() ).clone(); String dn = ( String ) entry.remove( "dn" ).get();
try { Entry entry =  (Entry)( ( Entry ) i.next() ).clone(); Attributes attributes = entry.getAttributes(); String dn = entry.getDn();
    private void createTestEntries( Hashtable env ) throws NamingException    {        String principal = AbstractContextFactory.getPrincipal( env );        byte[] credential = AbstractContextFactory.getCredential( env );        String authentication = AbstractContextFactory.getAuthentication( env );        ServerLdapContext ctx = ( ServerLdapContext ) getJndiContext( principal, credential, authentication, "" );        Iterator i = startupConfiguration.getTestEntries().iterator();        while ( i.hasNext() )        {            Attributes entry = ( Attributes ) ( ( Attributes ) i.next() ).clone();            String dn = ( String ) entry.remove( "dn" ).get();            try            {                ctx.createSubcontext( dn, entry );            }            catch ( Exception e )            {                log.warn( dn + " test entry already exists.", e );            }        }    }