throw (DataSetException)e.getException();
boolean foundDependentInSortedTableNames = false; String tmpTable = (String)i.next(); Set tmpTableDependents = getDependentTableNames(connection, tmpTable);   int sortedTableIndex = -1; for (Iterator k = sortedTableNames.iterator(); k.hasNext();) { String sortedTable = (String)k.next(); if (tmpTableDependents.contains(sortedTable)) { sortedTableIndex = sortedTableNames.indexOf(sortedTable); foundDependentInSortedTableNames = true; break; } }      if (foundDependentInSortedTableNames) { if (sortedTableIndex < 0) { throw new IllegalStateException( "sortedTableIndex should be 0 or greater, but is " + sortedTableIndex); } sortedTableNames.add(sortedTableIndex, tmpTable); } else { sortedTableNames.add(tmpTable); }
    private static String[] sortTableNames(IDatabaseConnection connection,            String[] tableNames) throws DataSetException, SQLException    {        try        {            Arrays.sort((String[])tableNames.clone(),                    new TableSequenceComparator(connection));            return tableNames;        }        catch (DatabaseUnitRuntimeException e)        {            if (e.getException() instanceof DataSetException)            {                throw (DataSetException)e.getException();            }            if (e.getException() instanceof SQLException)            {                throw (SQLException)e.getException();            }            throw e;        }    }