class DeleteSelectedRows extends SwingWorkerPM {

    public static void deleteUsingRowSet(ReversibleRowSet reversibleRowSet, SortedSet<Long> rowPkToDelete) throws SQLException, InterruptedException {
        TreeSet<Integer> rowNumberToDelete = new TreeSet<>(reversibleRowSet.getRowNumberFromRowPk(rowPkToDelete));
        Lock lock = reversibleRowSet.getReadLock();
        if(lock.tryLock(TRY_LOCK_TIME, TimeUnit.SECONDS)) {
            try {
                // Rows must be deleted in descending order in order to not introduce shift
                for (int rowNumber : rowNumberToDelete.descendingSet()) {
                    reversibleRowSet.absolute(rowNumber);
                    reversibleRowSet.deleteRow();
                }
            } finally {
                lock.unlock();
            }
        }
    }

    public  DeleteSelectedRows(SortedSet<Long> rowPkToDelete, String tableName, DataSource dataSource);

}