Java implementation of the 'sleeping barber' program.