class EventDispatchingThread {

    /**
     * The value of an object constructed by the construct() method.
     */
    private Object value;
    /**
     * A wrapper for the tread that executes a time-consuming task.
     */
    private ThreadWrapper thread;

    /**
     * Starts a thread. Executes the time-consuming task in the construct method; finally calls the finish().
     */
    public EventDispatchingThread() {
        final Runnable doFinished = this::finished;

        Runnable doConstruct = () -> {
            try {
                value = construct();
            } finally {
                thread.clear();
            }
            SwingUtilities.invokeLater(doFinished);
        };
        Thread t = new Thread(doConstruct);
        thread = new ThreadWrapper(t);
    }

    /**
     * Implement this class; the time-consuming task will go here.
     *
     * @return Object
     */
    public abstract Object construct();

    /**
     * Starts the thread.
     */
    public void start() {<FILL_FUNCTION_BODY>}

    /**
     * Forces the thread to stop what it's doing.
     */
    public void interrupt() {
        Thread t = thread.get();
        if (t != null) {
            t.interrupt();
        }
        thread.clear();
    }

    /**
     * Called on the event dispatching thread once the construct method has finished its task.
     */
    public void finished() {
    }

    /**
     * Returns the value created by the construct method.
     *
     * @return the value created by the construct method or null if the task was interrupted before it was finished.
     */
    public Object get() {
        while (true) {
            Thread t = thread.get();
            if (t == null) {
                return value;
            }
            try {
                t.join();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt(); // propagate
                return null;
            }
        }
    }

    /**
     * Inner class that holds the reference to the thread.
     */
    private static class ThreadWrapper {

        private Thread thread;

        ThreadWrapper(Thread t) {
            thread = t;
        }

        synchronized Thread get() {
            return thread;
        }

        synchronized void clear() {
            thread = null;
        }
    }
}

        Thread t = thread.get();
        if (t != null) {
            t.start();
        }
    
<no_super_class>