[Java] Define interface for read write locks.