Goldman Sachs Interview Question

How to prevent livelocks in java threading