Lamport and Ricart & Agrawalla implementation in Java