Solution to the dining philosophers problem in Java.