String[] lastNames = tableNames; String[] cloneNames = tableNames; do { lastNames = cloneNames; cloneNames = (String[])lastNames.clone(); Arrays.sort(cloneNames, tableSequenceComparator); } while(!Arrays.equals(lastNames, cloneNames));
    private static String[] sortTableNames(IDatabaseConnection connection,            String[] tableNames) throws DataSetException, SQLException    {        try        {            TableSequenceComparator tableSequenceComparator =                    new TableSequenceComparator(connection);            String[] lastNames = tableNames;            String[] cloneNames = tableNames;            do            {                lastNames = cloneNames;                cloneNames = (String[])lastNames.clone();                Arrays.sort(cloneNames,                        tableSequenceComparator);            } while(!Arrays.equals(lastNames, cloneNames));            return lastNames;        }        catch (DatabaseUnitRuntimeException e)        {            if (e.getException() instanceof CyclicTablesDependencyException)            {                throw (CyclicTablesDependencyException)e.getException();            }            if (e.getException() instanceof SQLException)            {                throw (SQLException)e.getException();            }            throw e;        }    }