java sleeping in a ball