<p>I'm wondering what good ways there would be make assertions about synchronization or something so that I could detect synchronization violations (while testing).</p>

<p>That would be used for example for the case that I'd have a class that is not thread-safe and that isn't going to be thread-safe. With some way I would have some assertion that would inform me (log or something) if some method(s) of it was called from multiple threads.</p>

<p>I'm longing for something similar that could be made for AWT dispatch thread with the following:</p>

<pre><code>public static void checkDispatchThread() {
    if(!SwingUtilities.isEventDispatchThread()) {
        throw new RuntimeException("GUI change made outside AWT dispatch thread");
    }
}
</code></pre>

<p>I'd only want something more general. The problem description isn't so clear but I hope somebody has some good approaches =)</p>

For the specific example you give, SwingLabs has some helper code to detect event thread violations and hangs.
https://swinghelper.dev.java.net/
A while back, I worked with the JProbe java profiling tools.  One of their tools (threadalyzer?) looked for thread sync violations.  Looking at their web page, I don't see a tool by that name or quite what I remember.  But you might want to take a look.
http://www.quest.com/jprobe/performance-home.aspx