class Collation {
    private SQLiteConnection conn;
    private DB db;

    /**
     * Registers a given collation with the connection.
     *
     * @param conn The connection.
     * @param name The name of the collation.
     * @param f The collation to register.
     */
    public static final void create(Connection conn, String name, Collation f) throws SQLException {<FILL_FUNCTION_BODY>}

    /**
     * Removes a named collation from the given connection.
     *
     * @param conn The connection to remove the collation from.
     * @param name The name of the collation.
     * @throws SQLException
     */
    public static final void destroy(Connection conn, String name) throws SQLException {
        if (conn == null || !(conn instanceof SQLiteConnection)) {
            throw new SQLException("connection must be to an SQLite db");
        }
        ((SQLiteConnection) conn).getDatabase().destroy_collation(name);
    }

    /**
     * Called by SQLite as a custom collation to compare two strings.
     *
     * @param str1 the first string in the comparison
     * @param str2 the second string in the comparison
     * @return an integer that is negative, zero, or positive if the first string is less than,
     *     equal to, or greater than the second, respectively
     */
    protected abstract int xCompare(String str1, String str2);
}

        if (conn == null || !(conn instanceof SQLiteConnection)) {
            throw new SQLException("connection must be to an SQLite db");
        }
        if (conn.isClosed()) {
            throw new SQLException("connection closed");
        }

        f.conn = (SQLiteConnection) conn;
        f.db = f.conn.getDatabase();

        if (f.db.create_collation(name, f) != Codes.SQLITE_OK) {
            throw new SQLException("error creating collation");
        }
    
<no_super_class>