Converted Deadlock test to jUnit