Anthology.deadlock is a project mainly written in Java, it's free.
A demonstration of a deadlock in Java, and one possible solution.